Subj : Re: SpiderMonkey threading issues To : netscape.public.mozilla.jseng From : Brendan Eich Date : Thu Mar 10 2005 09:44 am Brendan Eich wrote: > > If you use NSPR locking (PR_Lock, PR_WaitCondVar, etc.), then you need > either to create threads using NSPR (PR_CreateThread), or call JS > threadsafe code that calls NSPR locking primitives from a thread to > which NSPR can automatically attach. Cc'ing wtc, who can remind us of > the restrictions, if any on such a thread. Wan-Teh kindly replied by email as follows. /be On Wed, 09 Mar 2005 14:54:38 -0800, Brendan Eich wrote: >> Sean Proctor wrote: >> > >>> > The things I'm unsure of are: Do I need to use NSPR to create my threads? > >> >> If you use NSPR locking (PR_Lock, PR_WaitCondVar, etc.), then you need >> either to create threads using NSPR (PR_CreateThread), or call JS >> threadsafe code that calls NSPR locking primitives from a thread to >> which NSPR can automatically attach. Cc'ing wtc, who can remind us of >> the restrictions, if any on such a thread. Any native threads, whether they are created by NSPR (using PR_CreateThread) or not, can use NSPR thread synchronization functions (PR_Lock, PR_WaitCondVar, etc.). Native threads not created by NSPR will be given an NSPR thread ID automatically (we call this "attaching the thread) the first time they call an NSPR function. The NSPR thread ID will be automatically freed when the native threads terminate (using platform-dependent techniques). Wan-Teh .