4 ms·
Are Wren fibers automatically distributed across available CPU cores or is it all single-threaded?
by nilkn 11y ago
Are Wren fibers automatically distributed across available CPU cores or is it all single-threaded?
- munificent 11y agoSingle-threaded. The Wren VM itself is completely self-contained and has no global state. So, if you wanted to, you could host multiple VMs simultaneously, one for each thread, to get actual concurrency. You'd have to do the marshalling to move values from one to the other to get sharing or communication working, though.
- duaneb 11y agoIf the VMs are self-contained, what mechanism would they use to communicate? id be ok to use marshaling if the marshaling itself is the dominating cost of communication.
- ori_b 11y ago> what mechanism would they use to communicate? That's up to the program embedding them -- the idea is that you're the one implementing the communication and synchronization in the embedding program, rather than in Wren itself.
- munificent 11y agoExactly right.
- duaneb 11y agoI would imagine some base shared memory copy on write queue system would help here immensely.