Subj : Re: Still multithreading problems, but more nailed down To : netscape.public.mozilla.jseng From : John Bandhauer Date : Tue Jan 28 2003 10:56 am Many people use multithreaded SpiderMonkey. In fact the mozilla browser uses it this way. AFAIK, it is quite stable when used correctly. I suggest that your best course of action is to use http://groups.google.com/ and search for JS_BeginRequest or JS_THREADSAFE. This will find plenty of discussion threads from this newsgroup that address the problems that others have had that sound similar to yours. You'll see that sometimes bugs have been uncovered. But, the most common problems are caused by people not understanding exactly how to use the API. You should especially look at Brendan Eich's detailed answers to questions about how to use JS_BeginRequest/JS_EndRequest and the safe use of JSContexts in a multithreaded environment. Also, it sounds like you *may* not we working with a debug build as you sort out your problems. If this is the case then you might want to experiment using a debug build since there are various assertions in the code that may give you useful clues about API misuse. If you are still having problems after learning more about correct multithreaded Spidermonkey use then please post with specific questions. A reduced test case that illustrates the usage that is not working for you makes it much easier to understand and help with your difficulties. Hope this helps. John. Andreas Podgurski wrote: > Hi again! > Seems to be quiet exotic to use SpiderMonkey in the multithreaded version, > because nobody seems to answer such questions .I'm still having heavy > problems with its stability. In my app, there is a main thread, which does > visual output, a script is executed in a seperate thread. I figured out, > that the application doesn't crash, if I call JS_BeginRequest on the main > thread, too. But in this case, the script isn't executed anymore, > JS_EvaluateScript seems to hang in compilation, because none method of the > used objects is called and it doesn't return from JS_EvaluateScript. If I > call JS_BeginRequest only on the scripted thread, it crashes in the looping > operator of the script, which keeps that alive (In this case not equal, but > others don't work, too). If I call JS_BeginRequest on the main thread only, > it doesn't execute the thread, too. In which cases is JS_BeginRequest really > needed? The documentation doesn't go very deep in there. Any idea, if this > is a bug in JavaScript? If so, how to become shure of it? > I have to advance soon, because I have deadlines to hold, so it would be > nice, if somebody could give me a hand on this... > > Thanks in advance, > Andreas Podgurski > > .