We're staying away from the DOM on the non-main threads, but what else
should we be avoiding? One thing our js code does do is to call
nsIThread::sleep(). Could this be causing synchronization problems? Or
if not all XPCOM interfaces are threadsafe, how can I easily determine
which ones are not?
There were a pile of threading issues with JS 1.7 that I ran into myself.
Crashes, dangling pointers, hangs, you name it.
Most were covered by the following bugs:
https://bugzilla.mozilla.org/show_bug.cgi?id=345350 (crash in
js_FreeRuntimeScriptState - jsscript.c)
https://bugzilla.mozilla.org/show_bug.cgi?id=345365 (JS_ClearContextThread
leaves dangling pointers in JSContext)
https://bugzilla.mozilla.org/show_bug.cgi?id=351602 (crash when GCThing
exists in both rt and thread local freeLists)
etc...
The patch for bug 351602 will probably be checked in today.
After getting this patch re-compile js and try again.
If you are on windows make sure you also define JS_USE_ONLY_NSPR_LOCKS in
your js builds.
That solved a lock hang problem for me.
>If you are on windows make sure you also define JS_USE_ONLY_NSPR_LOCKS in
>your js builds.
>That solved a lock hang problem for me.
>
>
That has solved our hang problem. Why isn't this the default for Windows?
Because it was slower, when last performance-tested. That was years
ago, so it could be that we should switch -- but first, I'd like to
find the source of the hang you and Mike saw.
Mike, could you send me fresh trace data?
/be