4 ms·
Concurrency is easy if the library is well thought out and clean. So I much prefer the Plan 9 approach using the CSP thread(2) library: http://man.postnix.pw/9f
by MisterTea 6y ago
Concurrency is easy if the library is well thought out and clean. So I much prefer the Plan 9 approach using the CSP thread(2) library: http://man.postnix.pw/9front/2/thread http://man.postnix.pw/9front/2/thread, Example program: https://github.com/mischief/9problems/blob/master/sys/src/libthread/example.c https://github.com/mischief/9problems/blob/master/sys/src/li...
Wonderful easy to use library which is built on top of rfork and uses channels and alternates to synchronize the procs. Heap memory can be shared across processes (e.g. malloc'd memory or a segment(3)) so passing data around is just passing pointers to objects in shared memory.
Further reading which demonstrates the library and how it influenced Go can be found here: https://seh.dev/go-legacy/ https://seh.dev/go-legacy/