Open Bug 1200403 Opened 7 years ago Updated 2 months ago

SpiderMonkey does not allow runtimes to be switched between threads


(Core :: JavaScript Engine, defect)

31 Branch





(Reporter: rehrlich, Unassigned)


User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2; rv:11.0) like Gecko

Steps to reproduce:

When converting our application to SpiderMonkey v31, we noticed that the API functions JS_SetRuntimeThread() and JS_ClearRuntimeThread have been removed. Our application depends on being able to switch a runtime from one thread to another.

We use JavaScript as our script engine in our HTTP server. We use a 
runtime/context to maintain state of a user from one HTTP request to another 
(our concept of a session). This works very well for us to maintain random 
state information and reuse compiled scripts. Obviously sessions can last a 
long time and processing threads will come and go, but we must maintain 

See the discussion entitled "Re: Threading and runtime / context sharing" in the for more details.

Also the development team submitted
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.