Home Download Help Forum Resources Extensions FAQ NetLogo Publications Contact Us Donate Models: Library Community Modeling Commons Beginners Interactive NetLogo Dictionary (BIND) NetLogo Dictionary User Manuals: Web Printable Chinese Czech Farsi / Persian Japanese Spanish
|
NetLogo User Community Models(back to the NetLogo User Community Models)
WHAT IS IT?
The problem of Readers and Writers describes a computing problem with concurrency. This problem was described for the first time by P. J. Courtois et al. in their work from 1971.
Suppose we have a shared document. There are two types of agents in this model - readers, who access the document only for reading and writers, who access the document for modification. The problem is with the agents accessing this document at the same time.
HOW IT WORKS
FIRST TYPE OF R/W PROBLEM - readers-preference:
The main rule of this model is that no reader shall be kept waiting if the document is currently opened for reading.
HOW TO USE IT
Initial settings:
Plots:
THINGS TO NOTICE
From the number of writers in the system (unprocessed writers) you can see that in the first readers-writers problem the writers are starving. THINGS TO TRY
Try moving the sliders. For example, if you set the "probability-reader-comes" to a very low value and "probability-reader-leaves" to a very high value, the writers won't starve. |
(back to the NetLogo User Community Models)