25 ms·
You can use futures, which have access to underlying OS threads. They don’t share a memory space though. There’s also an Actor library called Goblins which is n
by mruts 7y ago
You can use futures, which have access to underlying OS threads. They don’t share a memory space though. There’s also an Actor library called Goblins which is nice, but I’m not sure if can use multiple cores.
- gus_massa 7y agoFutures are difficult to use, because if you allocate or you call any of the "forbidden" primitives the thread will block and resume automatically when it is safe to do the operation. They are good for numerical work, but you have to pay a lot of attention writing code with futures. It's more easy to use places, you can run whatever you want in places, but the communication between places is restricted and they have a big startup time (something like a quarter of a second) so if you create one, ensure that you are going to use it for a long time.