Subj : Re: [Q] Are roots associated with globals, contexts, runtimes or To : t o b e From : Brendan Eich Date : Thu Aug 26 2004 10:54 am t o b e wrote: > Less succintly: > > I use 1 runtime and a pool of contexts. Each thread wanting to run > javascript acquires a arbitrary JS context and sets its global object to > whatever the call context is. When the script is finished the global is set > back to null. Rinse, repeat. > > Does this sound like a bad idea ? This works fine. > I root and unroot objects under a null global. You can even root and unroot passing the JSRuntime *rt, not any JSContext *cx, so it doesn't matter if you use the cx-parameterized APIs for rooting and cx->globalObject is null. > Does this sound like a bad idea now ? No, and it never sounded bad to me ;-). /be .