Hacker News new | past | comments | ask | show | jobs | submit login

Sharing (immutable) data between threads is fine, you just don't want to share (mutable) state or else you run the risk of threads stomping on each other. The ideal scenario is map/reduce: you take some large chunk of data, divide it up into smaller chunks, spin up a thread to process each smaller chunk and produce a result. Once the threads have all completed and the results are no longer changing, the main thread can pick them up and combine them to a single result.

It's possible to do that with fork-and-exec, but without a shared address space, marshalling costs make it expensive.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact