Jun
13
Synchronizing threads using mutexes
In the high-level world, we prefer to use Actors or the STM model - but it has to rely on something, right? Here’s the low-level part of concurrency in ooc: threads and mutexes. Implemented on PThreads for Unix-y platforms, and with Win32 threads on Windows.
Meanwhile, here’s a small example of mutex usage in ooc.
EDIT: Mutex works on Linux, OSX, and Windows now - enjoy!