My main program (C++) creates context, global object, loads a .js file, 
creates a new v8::Script, and runs it.

The JavaScript code does a call to an exposed function in the global 
object, fork(), which calls the OS' fork function and returns its return 
value.

The fork() call works as expected - I have a parent and child process, each 
continues running in the JavaScript context from where fork() returns.

However, there are two issues I'd like some help with.

First, there is a tick thread in the parent process that JIT optimizes the 
JS code as it executes.  After fork(), this is not running in the child 
process' space.  In fact, all the v8 internal (and private) variables are 
cloned by fork() so v8 actually thinks there is a tick thread running. 
 What I'm looking for is a way to modify my fork() C++ code to do the 
fork() an start up the tick thread before returning.  Any clues on how to 
do this?  Remember, v8's internal variables tell it the thread is running 
even though it isn't.

Second, when I enable the debugger, the client apps (like d8) can connect 
to the program and do some of the commands, but it stops working after a 
bit.  I'm not entirely sure what's going on here, but my guess is that the 
cloned (by fork) contexts think they're one and not many and this confuses 
the debugger logic.  Or maybe it's that I'm doing the 
SetDebugMessageDispatchHandler 
logic in the parent process? Any clues here would be greatly appreciated.

Thanks in advance.

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

Reply via email to