Subj : Re: JS_EvaluateScript on simple thread To : Jacknill From : Brendan Eich Date : Fri Sep 17 2004 06:44 pm Jacknill wrote: > I´ve read that is possible to use the same context in multiple > threads, but one thread at a time. > > How can I do that? > > JS_BeginRequest(cx_glob); > JS_EndRequest(cx_glob); > > Doesn´t done that? Obviously not. You need to create a context per thread that might be executing JS concurrently. If you can pool threads and their contexts, then you can minimize the number of extra contexts. When reassociating a pooled context to a new thread, don't forget to use JS_SetContextThread. /be .