# Section 8.4:
Concurrency Classes

This section of the required library contains definitions of those abstractions and classes which support the concurrent and distributed aspects of the Sather language.

1. Abstract Classes

   1. $MUTEX - this abstraction models the notion of mutual exclusion access to some resource/object.
   2. $BARRIER_LOCK - this abstraction models the concept of a lock providing a barrier to accessing some object.
   3. $COND_LOCK - this abstraction models a lock which may be tested without blocking.
   4. $READER_LOCK - this abstraction models the kind of lock needed by a reader in a client/server situation.
   5. $WRITER_LOCK - this abstraction models the kind of lock needed by a wrtier in s mutual exclusion client-server situation.
   6. $RW_LOCK - this abstraction models both reader and writer locks which may be found in a client/server situation.
   7. $ATTACH_SYNC - this abstraction is a variant of $ATTACH which does not provide for 'death'. It provides for synchronisation within external service components.
   8. $REENTRANT - this abstraction models the abstraction of re-entrant code handling via a lock mechanism.

2. Immutable Classes

   1. THREAD_ID - this class implements the concept of an environment provided token uniquely identifying an individual thread of control.
   2. TIMING - this class provides thread or program suspension facilities for some specified period of time.

3. Reference Classes

   1. ATTACH - this class implements the simplest possible attach class.
   2. ZONE - this class implements the the abstraction of a zone which is a collection of objects, threads and other zones. A zone is bound to a particular cluster at runtime.
   3. LL_LOCK - this class implements a primitive locking facility required. There is no guarantee of fairness.
   4. SPINLOCK - this class implements a primitive spinlock intended for use solely in short critical regions of code.
   5. PAR_ATTACH - this class implements the birth/death synchronisation which is provided for use with `par` statements.
   6. PAR_ATTACH_NO_THREAD - this class implements attachment to a non-threaded code object.
   7. DOOR_LOCK - this class implements a simple mutual exclusion door lock.
   8. CONDITIONAL_LOCK - this class implements a conditional lock which may be tested without blocking.
   9. CONTAINER_LOCK - this class implements a lock for a container of some kind, the individual components of which may be locked separately.
   10. RENDEZVOUS_LOCK - this class implements a rendezvous between threads each of which acquires one of the two locks.
   11. WR_LOCK - this class implements a reader/writer lock which is not necessarily guaranteed to be fair.
   12. RW_LOCK - this class implements a reader/writer lock with reader priority.
   13. FRW_LOCK - this class implements a fair reader/writer lock.
   14. FWR_LOCK - this class implements a fair reader/writer lock. it is identical to the one above.
   15. FMUTEX - this class implements a 'fast' mutual exclusion lock, which does not use a lock manager - for speed.
   16. FMUTEX_SPIN - this class implements a 'fast' mutual exclusion lock, which does not use a lock manager - for speed.
   17. SMUTEX - this class implements a 'slow' version of FMUTEX which is fair.
   18. QMUTEX - this class defines a mutual exclusion lock which may only be locked by one thread at a time - although a single thread may lock it repeatedly without causing deadlock.
   19. MUTEX - this class implements a single lock version of a mutual exclusion lock manager.
   20. SEMA - this class implements the classic counting semaphore.
   21. FUTURE - this class implements thread birth and death operations, returning a value on death.
   22. GATE - this class implements a gateway through which critical sections of activity may be entered and left - such that only one thread is active in the region at once.
   23. VISITOR_MUTATOR - this class implements a simple solution to the classic readers/writers problem.

| Language Index |  | Library Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Friday, 10 March 2000. |