On Tue, Jun 26, 2012 at 7:47 PM, Michael Schwartz <[email protected]> wrote:

> Something else I discovered early on in SilkJS development is that you can
> call from JS, a C++ function that calls fork() and returns.  After the
> return, you have a parent and child process resuming in JS context.  The
> child process is a literal clone of the parent, including the context and
> it's global and everything compiled in.  So if you have a "pristine" global
> object set up by JS and call fork() for each request, you have a pristine
> global in the child
>

Nice idea. To drag us off topic for a moment... i implemented fork() for
SpiderMonkey some years ago but never really trusted that the JS engine
would behave properly if forked, so i never used it. Does v8 provide any
specific guarantees in the face of forking, or are you aware of any notable
down-sides to using fork() from JS in generic client code?

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to