My thinking is that I'm lucky enough that fork() clones the V8 context as-is.

Again, using the JavaScript overload technique:

var old_fork = process.fork;
process.fork = function(childMethod) {
  if (old_fork()) return;
  childMethod();
  process.exit();
}

;-)

And yeah, I'm going to excise the HandleScope everywhere in the builtin API.  
It's not been causing errors, but I'm sure it'd save some clock cycles.



On Apr 12, 2012, at 6:59 AM, Stephan Beal wrote:

> On Thu, Apr 12, 2012 at 3:55 PM, Michael Schwartz <[email protected]> wrote:
> https://github.com/mschwartz/SilkJS/blob/master/src/process.cpp#L77
> 
> It works, but the child process doesn't have the debugger or tick threads 
> running anymore.  Any idea how to get those running again?
> 
> Unfortunately, no. i implemented fork() for the SpiderMonkey engine back in 
> 2007, but that was threadless and in C, so i never had any significant 
> problems with it (other than having absolutely no idea whether or not the JS 
> VM reacted properly after forking).
> 
> But in any case:
> 
> 
>       HandleScope scope;
> 
> 
>       return scope.Close(Integer::New(pid));
> 
> 
> That scope isn't necessary - your fork() is already being called from v8 and 
> has an implicit scope.
> 
> -- 
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> 
> 
> -- 
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users

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

Reply via email to