Spidermonkey 24 and JS_SuspendRequest

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Spidermonkey 24 and JS_SuspendRequest

Christian Comaschi
Hello,
I'm trying to embed SpiderMonkey 24 into a multithreaded application. I
learned from the docs that if a JSNative function must wait for a long
task to complete, JS_SuspendRequest and JS_ResumeRequest must be called,
but in SpiderMonkey 24 these two functions were removed.
Can you please tell me what is the new way to allow other threads to
garbage collect when a long task is going to be run in a JSNative?
Thanks in advance,
Christian
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: Spidermonkey 24 and JS_SuspendRequest

Boris Zbarsky
On 3/3/14 5:13 AM, Christian Comaschi wrote:
> Can you please tell me what is the new way to allow other threads to
> garbage collect when a long task is going to be run in a JSNative?

In Spidermonkey 24, you can only have one thread that's using a given
JSRuntime.  Since GC is runtime-local, there is no way for GC to happen
on the JSRuntime of the blocked thread while it's blocked (though of
course if the long-running JSNative makes calls back into JSAPI those
could GC).

-Boris

_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine