The Readers/Writers Problem


A common paradigm in concurrent applications is isolation of shared data such as a variable, buffer, or document and the control of access to that data. The readers/writers problem is an example of this. This problem has two types of clients accessing the shared data. The first type, refered to as readers, only wants to read the shared data. The second type, refered to as writers, may want to modify the shared data. There is also a designated central data server or controller. It enforces exclusive write semantics; if a writer is active then no other writer or reader can be active. The server can support clients that wish to both read and write.

Our implementation of this problem consists of at least 3 tasks; the control task, one reader, and one writer. It is scalable. To increase the size of the problem, additional readers and writers can be added.


The size specifies the numbers of readers/writers there are in the source code. For example for size 2, there are two readers and two writers for a total of four clients. The examples given here have the same number of readers and writers, but this is not necessary.

size : 2 , 3


Some specific properties are provided below:


The property specifications by formalism are:


Back to main