On Sun, Feb 12, 2012 at 10:51 PM, michael bienstein <[email protected]>wrote:
> 1) I can easily ensure that only one thread accesses an isolate at a > time - do I still need to use the Locker class? > According to recent discussions on this list, yes, you still need the Locker. > 2) I will use windows fibers to manage chunks of parallelizable work. > If running some JavaScript code in a fiber results in calling the > heavy duty backend, I want to make the fiber yield. What happens to > the isolate, handlescope and lockers in this case? Do they remain > associated only with the fiber or with the thread overall? > It is my understanding that you can yield a thread by using v8::Unlocker. While the Unlocker is in scope it is illegal to use _any_ v8 APIs but you can access your own code/back-end (provided it is not thread-illegal to do so). When the Unlocker goes out of scope, the most recent Locker will wait to regain control. (At least that's my understanding.) -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
