> > There is no V8 main loop. There is however the libuv / node.js event > loop. > > Thanks for clarifying. I also meant that when nodejs does v8::Initialize() that thread becomes the v8 main thread.
> If you want to execute JS code, you can do so with v8::Script::New() > or v8::Script::Compile(). If you want to call into an _existing_ JS > function, use either v8::Function::Call() or, preferably, > node::MakeCallback(). > > > If your add-on uses threads, be advised that it's not safe to call > into V8 from another thread, not even when you have the Locker for the > main Isolate. Yes my addon has threads. I would heed to your advise. You need to set up some kind of communication channel > with the main thread. uv_async_send() can help - it wakes up the > event loop - but you still need cross-thread synchronization, like a > mutex or an rwlock. Libuv provides mutexes, barriers, rwlocks, etc. > See uv.h for details. > Does it mean that i would have to set up a uv_async_init with my watcher in node.cc code ? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
