News for hackers. Stuff that matters.
Re:Node.js on mozilla spidermonkey by bnoordhuis on Thursday April 21, 2011 @09:34AM (#2470534)
I hear you, threading in SM is indeed fraught with dangers.

On the off chance that you're going to revisit it, the way to go is to compile with -DJS_THREADSAFE and register a callback with JS_SetGCCallback() that tells the VM when it's safe to run the garbage collector.

Actually, the approach I took was to always tell the VM 'no' and invoke JS_GC() manually from time to time. Conceptually easy and performance is mostly amortized.

PS: Feel free to contact me if you have follow-up questions, my email is in my profile.

There are no comments on this comment yet.