I think I would like to *copying* the Value and store the Value to a place that other thread can access. But I don't know how to make that kind of copy. Below is my case: I have some other thread in the addon, and I have to call some APIs on those thread. The parameters I'm using to call those API come from the javascript. I just want to copy those parameters, for instance, copying v8:String, v8:Int32
Do you have any code examples on copying those value, so any other thread can access them at any time. On Thursday, April 11, 2013 6:35:52 PM UTC+8, Ben Noordhuis wrote: > > On Thu, Apr 11, 2013 at 10:28 AM, Jerry Yin <[email protected]<javascript:>> > wrote: > > Thanks for your reply. I used locks. > > > > My question is how to share a v8::Local<v8::Value> between thread? > > The short answer is: You don't, V8 is not thread safe. > > The longer answer is: If you embed V8 in your application, you can use > the v8::Locker API to coordinate VM access between threads. YMMV may > vary in node.js because node.js never releases the lock. > > It's not exactly clear to me what values you are sharing and why but > you will likely have to copy the data out of the V8 VM before you hand > it off to another thread (effectively unsharing it.) > -- -- 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.
