Thanks for the replies.
I am on windows, so no silkjs. I don't understand your point about it
though. Do you use fibers somehow to do synchronous JS?
Yes, an Unlocker will release the locks on the thread. However, what
interests me is how this works with fibers, not threads. If it is all
stack allocated, then each fiber has its own stack and it should
logically work. But if it wraps OS concepts, it might not.
If I have an isolate per user say, and a user makes a network call
(not web) that the main listening thread handles by creating a sort of
Task object that it places into a queue. The fiber pool then pops this
in one of the worker fibers. It enters the isolate and enters a lock.
It runs JS code. This code calls back into the c++ and at that point
we want to schedule a different task or tasks into the fiber pool
because it can do some massive parallel computation separate CPUs. So
I want to release the lock, but not the isolate and yield to other
fibers. The other fibers wake up and do the work without JS code and
when done, they signal the original fiber. It gets woken when it's
thread gives up a fiber and it requires the lock and uses th. results
back to JS code which does further manipulation before returning back
to c++ code releasing the isolate and the lock and then the network
response to the caller.
The questions are, do I even need locks since I already manage only
one thread in the isolate at a time and then if I need the locker
class, will Unlocker work at a fiber level, or will there be strange
effects because the one thread is running different, unrelated fibers
while the lock is still on one fiber's stack?
Thanks,
Michael
On Feb 13, 10:10 am, Stephan Beal <
sgb...@googlemail.com> wrote: