Next Previous Up Top Contents Index

3.5 Threads: the Threads structure

3.5.1 Mutual exclusion primitives

The mutexes implementation can be fount in the utils subdirectory. The distribution contains the object files mutex.mo and __mutex.mo, plus the signature MUTEX. These objects are not part of the bases, and are therefore not automatically loaded into the image.

Mutexes work with the thread mechanism running in preemption mode.

There are five different demonstration programs in MLWorks\examples\threads:

dining_philosophers.sml
sleeping_barber.sml
bounded_buffer.sml
cigarette_smokers.sml
readers_writers.sml 

Documentation of the mutex interface follows.

Mutex
mutex
newCountingMutex
newBinaryMutex
test
testAndClaim
wait
signal
query
allSleeping
cleanUp
critical
await

MLWorks Reference Manual version 2.0 - 29 Jul 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker