Subj : call for help to build SpiderMonkey threadsafe in windows To : netscape.public.mozilla.jseng From : "wangying" Date : Mon Jun 02 2003 07:21 pm Hi, everybody Can you tell me how to build the SpiderMonkey C engine threadsafe in win2000 with compiler vc6? thanks a lot. I downloaded js-1.5-rc5a.tar.gz and nspr-4.3.zip from mozilla. After unpacking js-1.5-rc5a.tar.gz, I got the engine's source file. Unpacking nspr-4.3.zip I got nspr's header files and compiled libs and dlls. the directory structures as follow: c:\jsengine\spidermonkey\js\src c:\jsengine\nspr\include c:\jsengine\nspr\lib Then I modified js.mak as follows: cd JavaScriptEngine\SpiderMonkey\js\src\ a.. copy js.mak ts_js.mak b.. In ts_js.mak, make the following changes. c.. Add /D "JS_THREADSAFE" to all the CPP_PROJ defns. d.. Add /I "../../../nspr/include" to all the CPP_PROJ defns. e.. Add libnspr4.lib /libpath:"../../../nspr/lib" to all the LINK32_FLAGS defns Then I run in command line: C:\...\src\nmake /f ts_js.mak After compiling, I got js32.dll and js32.lib It seems everything is ok, but when I used windows API CreateThread()(_beginthreadex()) or nspr API PR_CreateThread() created multithreads with every thread associated with its own Runtime and Context, It didn't work! The engine would reference to unreadable address after threads began few seconds. When with single thread, It works well. What is wrong with it? Can you help .