From: Keith Gaughan Date: 2006-09-29T05:49:17+09:00 Subject: Re: continuations across fork? On Fri, Sep 29, 2006 at 02:10:52AM +0900, Clifford T. Matthews wrote: > I wrote some code that deliberately uses continuations that cross a > fork boundary. When I went to test it, I was surprised by the error: > "continuation called across trap". I can think of a few reasons why > people might not want to use continuations across fork, but not > knowing Ruby internals particularly well, I couldn't see a reason why > it should be absolutely prohibited. Probably because you're attemptin to jumP to part of a completely different process. Program counters can't jump between processes like that. You'll have to do what's usually done: set up an IPC channel of some kind between the parent and child processes (be it a pipe, socket, a mmap'd file object, SysV shared memory and semaphores, whatever) and get them to talk to one another. > I realize there are several other things I could do other than the > above. However, I coded up my solution without realizing that you > can't call a continuation across fork. Now I'm curious why it's > disallowed. K. -- Keith Gaughan -- kmgaughan@eircom.net -- http://talideon.com/ "I told all of my friends how they were losers for running UNIX. They should switch to NT.... That was more or less my constant refrain until a single pivotal event changed my life: I actually tried to use NT. -- Philip Greenspun