I have contributed to TAGG, i patched it to work with node-gyp :) I just want nodejs to run in a separate thread. Threads are not processes, I am aware. But if I had a possibility to create an isolate that only worked in that separate thread, would that work? I mean, you say that I can make an isolate depend on that other thread, instead of the main one. To be honest, I dont know how thread-safe nodejs is, I just know that it tries to be, by using Lockers and the like.
But, I will look into TAGG again and see what I can find! ^^ Am 20.03.2014 um 12:03 schrieb Ben Noordhuis <[email protected]>: > On Thu, Mar 20, 2014 at 11:24 AM, Kevin Ingwersen > <[email protected]> wrote: >> So, do I need to create the isolate before spawning the new thread, and make >> node access that? >> >> Node just really creates a pretty basic isolate. >> >> static Isolate* node_isolate = NULL; >> // snip >> >> // in: int Start(...) >> V8::Initialize(); >> { >> Locker locker(node_isolate); >> Environment* env = >> CreateEnvironment(node_isolate, argc, argv, exec_argc, exec_argv); >> // snip >> >> // in: CreateEnvironment(...) >> HandleScope handle_scope(isolate); >> >> Local<Context> context = Context::New(isolate); >> Context::Scope context_scope(context); >> // cut. >> >> So, appearently it must be using the default isolate. This is the only code >> that seems to initialize or even use the isolate. Well okay, its used far >> more often, but that is at the very beginning, and part of the startup code. >> What do I need to change to make it thread-conform? x) > > If I understand you correctly, you cannot do that. Node.js is > currently built around the concept of a single isolate and besides > that, it's very much thread-unsafe. > > If you want to create an isolate that doesn't use anything from > node.js, that's another story. Google for 'threads a go go' (often > abbreviated to TAGG), it's an add-on that does exactly that. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" 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/d/optout.
