On Sun, Sep 16, 2012 at 11:51 PM, rektide <[email protected]> wrote: > Threads are great. Fact. Better than processes (at at least context switching > and > transfering objects). Fact.
It's much (much!) more nuanced than that. Threads in most common threading implementations are only marginally cheaper than processes. You avoid some TLB flushes and that's about it. That small gain is offset by the need to serialize access to your data structures - which is often a lot more expensive than the small gain you get by using threads. As for transferring objects, you don't need threads for that, just shared memory. We'll probably implement that someday but don't expect too much from it. Shared memory avoids some syscalls but the cost of moving the object from one V8 heap to another remains. By the way, if you want to hasten that day, post (non-contrived) benchmarks that conclusively show that IPC is a bottleneck. :-) -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
