With semaphores and shared memory you can basically emulate the
behaviour you would expect from native threads. Though I'm not certain
about how comparable it is in performance, I understand it to be quite
zippy.
Ie, shm_open will give you a file descriptor, which you can then treat
as a memory buffer by using mmap, and using semaphores you can safely
signal across processes whether someone is in a critical section or not.
To me, the drawback is in that creating a shared memory object and
wrapping it in mmap is clunkier than just sharing all in-process memory
with a bunch of native threads. But the upshot is that it can be a lot
safer in practice, especially when you have many hands in the pot and
not much rigor is being taken towards thread safety.
Regarding Chicken threads, as far as I'm aware SRFI-18 threads in
Chicken are 'green', in that they run on a single native thread and
cannot avail themselves of additional native threads.
You mention that you've been poking at native threads for a while. Do
you have a native thread implementation that could be packaged up as an
egg? I think some people would be eager to try it out, even if its
incomplete. Maybe this would be a good opportunity to get used to Git
via a GitHub project? ;)
Thanks,
-Dan
_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users