Subj : Re: Embedded Spikermonkey with multi-threaded server... To : Corillian From : Brendan Eich Date : Wed Oct 27 2004 11:23 pm Corillian wrote: > I am writing a multi-threaded server that is using spikermonkey to extend > the application. I was wondering is spidermonkey capable of simultaneously > executing multiple scripts within a single context (thread)? That makes no sense -- how can you "simultaneously" (software concurrency, hardware parallelism) execute multiple scripts in one thread? If you mean by using multiple coroutines (user-level threads, fibers, whatever the OS calls them) within one OS or hardware thread, the answer is yes -- because such coroutines provide their own stack. But you can't use a JSContext from more than one thread or coroutine at a time, or all hell will break loose. The context contains the stack and VM registers, so those pigeon-holes would be contested and clobbered by the several "simultaneous" users. Why aren't you using a context per thread, and a runtime per process? /be .