4 ms·
What simplicity/safety does using processes buy you relative to a good threaded runtime (read: JVM/Haskell/Go)?
by yummyfajitas 13y ago
What simplicity/safety does using processes buy you relative to a good threaded runtime (read: JVM/Haskell/Go)?
- otterley 13y agoBuilding a good threaded runtime is difficult in the first instance, and even then, shared memory requires special handling (mutexes). There has been plenty of ink spilled on the subject, but here's a good read: http://msdn.microsoft.com/en-us/magazine/cc163744.aspx http://msdn.microsoft.com/en-us/magazine/cc163744.aspx
- yummyfajitas 13y agoBuilding a JVM is harder than building an RVM. I was asking from the perspective of user code. Shared memory requires mutexes in both threaded and forked code - this is not an advantage of multiple processes. In fact, multiprocess shared memory is generally harder to work with than threaded shared memory.
- otterley 13y agoWe're talking about Ruby here, though. MRI threading has concurrency limitations, so processes are better here IMO. I tend to think out of the box for multiprocess shared memory - Kyoto Cabinet and Redis can be helpful here, to name a few. Even SysV shared memory is pretty easy to use.