3 ms·
The problem is that C expects to have enough stack to put stuff there, but green threads allocate small stacks to reduce (virtual) memory use.
by ori_b 1y ago
The problem is that C expects to have enough stack to put stuff there, but green threads allocate small stacks to reduce (virtual) memory use.
- layer8 1y agoThat’s not a problem when a dedicated thread pool is used as mentioned by GP. However they don’t solve the thread affinity issue.
- ori_b 1y agoThat's the reason for the thread pool, and the resulting thread affinity issue.
- layer8 1y agoThis seems to assume that the same green thread will always run on the same native thread, which I don’t think is universally the case.
- yxhuvud 1y agoDifferent languages give different level of control over that. There are languages with one main thread pool and perhaps some specialized ones that users don't have control over. Go would be an example of this. It is also possible for languages to make user creatable thread pools - possibly even with affinity to cores, allowing fibers to run only on a single thread. Crystal is coming along that path. So far it seems to be coming around fairly nicely but I havn't had to battle the GC in anger yet.
- ori_b 1y agoI don't understand why that matters.