Subj : Re: Can I have more than one runtime to facilitate multiple threads? To : netscape.public.mozilla.jseng From : davisc@iivip.com (Chris Davis) Date : Tue Jul 01 2003 08:17 am Brendan Eich wrote in message news:<3F00A524.5050206@meer.net>... > What locks? What stacks? We were concerned with all JS code that issues locks from the single runtime I had in the threaded version. For example, JS_LOCK_GC(rt) out of JS_BeginRequest(). > What version of SpiderMonkey were you using? js-1.5-rc5a.tar.gz in conjunction with nspr-4.2.2 > How do you know where the CPU was in the single-process case? Admittedly, only via process of elimination as we looked at the code. It was obvious that hundreds of threads were making tons of calls to JS_ResumeRequest and JS_SuspendRequest for different contexts all derived from a single runtime. > You're overlooking jsarena.c, jsdtoa.c, and jsstr.c global variables and > locks, at the least. Ok - we will run with the threadsafe stuff enabled when we try different runtimes. > Since > the fix for bug 54743 went in at the end of 2000, JS has avoided object > lock overhead for all objects used by only one thread. In my case I had 200+ threads using the single run time object. Would that optimization have helped the run time's locks? > Maybe you're using one thread to create all other > threads' objects We had one thread create the single run time, then all 200+ threads created their own contexts within their own thread. Thanks for your help, it shouldn't take too long to try the multiple runtimes with full npsr threadsafe like you suggested. .