Skip navigation links

Package pt.ua.concurrent

A concurrent library based on Design-by-Contract.

See: Description

Package pt.ua.concurrent Description

A concurrent library based on Design-by-Contract.

This package implements a Design-by-Contract based concurrency library for programming language Java. One of its mains features is its simplification of the usage of native Java concurrency constructs (wait, notify, notifyAll, join, etc.) by replacing the annoying InterruptedException checked exception with an equivalent ThreadInterruptedException unchecked exception (easing the development of concurrent Java code, and preventing a serious source of Java bugs due to the erroneous algorithm of ignoring exceptions).

This library is also the base of a new approach for object-oriented concurrent programming in which both models of thread communication -- shared object and message passing -- are supported. In the shared object model it is possible to fully synchronize a shared object with all the three aspects required -- internal, conditional and external -- without forcing the internal synchronization of the object to a monitor (mutual exclusion). In fact, one may safely use an internal synchronization scheme based on CoW (copy-on-write) or transactions, and still be able to externally synchronize the shared object.

This package contains the following groups of modules:

Base library modules:

InterruptibleAwaitingThreads: Java's interface to extend support for Interruptible Awaiting Threads
CThread: a replacement of Thread
CRunnable: a replacement of Runnable (to correctly handle exceptions and to register start time)
ThreadInterruptedException: InterruptedException unchecked exception replacement
CObject: a replacement of Object for Sync and/or SynCV purposes
WrapRunnable: transforms a Runnable into a CRunnable

Utility modules:

Console: output to a console supporting colors
Metronome: implementation of an active (thread) metronome class, able to periodically synchronize any number of threads

Elementary synchronization modules:

Signal: a simple signal abstraction module
TransientSignal: a transient signal module
PersistentSignal: a persistent signal module
Event: a simple module supporting two valued events
Semaphore: a standard general semaphore
BoundedSemaphore: a semaphore bounded by a maximum value
BinarySemaphore: a binary semaphore
Channel: a simple module support a (generic) communication channel between two threads
Exchanger: a simple module support a (generic) exchanger (bidirectional) communication channel between two threads

Locking modules:

Sync: Java's interface for locks
SyncCV: Java's interface for condition variables
Mutex: a POSIX-threads alike mutual exclusion synchronization class
MutexCV: a POSIX-threads alike mutex condition variable class
RWEx: a readers-writer exclusion synchronization class
RWExCV: a readers-writer exclusion condition variable class
GroupMutex: a group exclusion synchronization class
GroupMutexCV: a group exclusion condition variable class
SyncState: an internal module (to ease the implementaion of getStateAndUnlock/recoverState services)
GroupMutexComposedCV: composed group mutex CV to allow a CV applicable to a GroupMutex and one of any element of an array of Sync objects
MutexSetCV: a Mutex set condition variable class
AtomicLockingMutexSet: atomic locking operation on an unordered set of mutexes

Barrier modules:

Barrier: a thread barrier interface
InternalBarrier: an internally triggered thread barrier abstract class
ExternalBarrier: an externally triggered thread barrier abstract class
FixedBarrier: a fixed sized thread barrier class
DynamicBarrier: a dynamically sized thread barrier class
TriggeredBarrier: an externally triggered thread barrier class

Message passing modules:

Actor: an actor communication class
Future: actor's future results class
Version:
0.9
Author:
Miguel Oliveira e Silva (mos@ua.pt)
Skip navigation links