Package org.metasyntactic.thread

Interface Summary
ReaderWriterMonitor Threads that share data structures can run into problems if one of the threads is writing into the structure while another thread is reading it, or if two threads try to write into it at the same time.
 

Class Summary
AlternatingReadersWritersMonitor The Alternating-Readers/Writers Monitor will give the shared structure to a waiting writer when readers have finished with it and to readers when a writer has finished with it.
Monitor This class exists because I am a bad programmer.
ReadersPreferredMonitor Implementation of MultipleReadersWritersMonitor that gives preference to readers.
SingleReaderWriterMonitor This is equivalent to a Semaphore.
TakeANumberMonitor As each reader or writer arrives, it takes the next number and threads are served in order by their number.
WritersPreferredMonitor Implementation of MultipleReadersWritersMonitor that gives preference to writers.