replacement for JS_SetContextThread and other questions

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

replacement for JS_SetContextThread and other questions

luismarianoguerra
hi!

I'm working on the update of erlang_js (the library used by riak to bridge to js),
and I updated it from a really old release to spidermonkey 17 (the latest stable release), I managed to make it compile again but I have some doubts, the pull request is here, any extra feedback on the changes is more than welcome:

https://github.com/basho/erlang_js/pull/44

my main doubt is which is the replacement for JS_SetContextThread and JS_ClearContextThread, they aren't available in mozjs 17 and I need to know if removing it in a multithread environment (erlang) is safe or which is the correct solution.

now that we are at it, some extra questions:

JS_GC(JS_GetRuntime(context)) // is this the correct way to get the runtime?

uintN is no longer available, is changing the type to unsigned the correct solution?

is replacing JS_SetScriptStackQuota for JS_SetNativeStackQuota the correct solution?

the same for JS_SetBranchCallback being replaced by JS_SetOperationCallback

JSFUN_FAST_NATIVE for 0

I also would like to know if this is the best way to destroy a context and runtime:

https://github.com/marianoguerra/erlang_js/blob/d0db7141403ef9c94ee4a7a0d20f54a35e279310/c_src/spidermonkey.c#L180

thanks in advance!

_______________________________________________
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: replacement for JS_SetContextThread and other questions

Bobby Holley-2
Multithreaded environments are no longer supported in SpiderMonkey. You'll
need to use a separate JSRuntime per thread.

bholley


On Tue, Nov 19, 2013 at 9:37 AM, <[hidden email]> wrote:

> hi!
>
> I'm working on the update of erlang_js (the library used by riak to bridge
> to js),
> and I updated it from a really old release to spidermonkey 17 (the latest
> stable release), I managed to make it compile again but I have some doubts,
> the pull request is here, any extra feedback on the changes is more than
> welcome:
>
> https://github.com/basho/erlang_js/pull/44
>
> my main doubt is which is the replacement for JS_SetContextThread and
> JS_ClearContextThread, they aren't available in mozjs 17 and I need to know
> if removing it in a multithread environment (erlang) is safe or which is
> the correct solution.
>
> now that we are at it, some extra questions:
>
> JS_GC(JS_GetRuntime(context)) // is this the correct way to get the
> runtime?
>
> uintN is no longer available, is changing the type to unsigned the correct
> solution?
>
> is replacing JS_SetScriptStackQuota for JS_SetNativeStackQuota the correct
> solution?
>
> the same for JS_SetBranchCallback being replaced by JS_SetOperationCallback
>
> JSFUN_FAST_NATIVE for 0
>
> I also would like to know if this is the best way to destroy a context and
> runtime:
>
>
> https://github.com/marianoguerra/erlang_js/blob/d0db7141403ef9c94ee4a7a0d20f54a35e279310/c_src/spidermonkey.c#L180
>
> thanks in advance!
>
> _______________________________________________
> dev-tech-js-engine mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>
_______________________________________________
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: replacement for JS_SetContextThread and other questions

Bobby Holley-2
On Tue, Nov 19, 2013 at 10:53 AM, Mariano Guerra <
[hidden email]> wrote:

> Quoting Bobby Holley (2013-11-19 19:24:12)
> > Multithreaded environments are no longer supported in SpiderMonkey.
> You'll need
> > to use a separate JSRuntime per thread.
>
> if a JSRuntime runs in one thread and just one thread at any given time is
> that a problem?
> or it must run in the same thread it was created all the time?
>

There used to be a mechanism to explicitly munge the owner thread of a
given JSRuntime (which we used for cycle collection), but I don't see it
anymore on trunk. Anyone know if that went away?
_______________________________________________
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: replacement for JS_SetContextThread and other questions

Andrew  McCreight
Yes, there is no longer a special CC thread, so that mechanism was removed.

----- Original Message -----

> On Tue, Nov 19, 2013 at 10:53 AM, Mariano Guerra <
> [hidden email]> wrote:
>
> > Quoting Bobby Holley (2013-11-19 19:24:12)
> > > Multithreaded environments are no longer supported in SpiderMonkey.
> > You'll need
> > > to use a separate JSRuntime per thread.
> >
> > if a JSRuntime runs in one thread and just one thread at any given time is
> > that a problem?
> > or it must run in the same thread it was created all the time?
> >
>
> There used to be a mechanism to explicitly munge the owner thread of a
> given JSRuntime (which we used for cycle collection), but I don't see it
> anymore on trunk. Anyone know if that went away?
> _______________________________________________
> dev-tech-js-engine mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine