Semaphores
Posted: Wed Feb 15, 2006 12:00 am
Hi,
this post is pertaining to my attempt in understanding semaphores through a given scenerio.
[you are sharing a small refrigerator with two roommates.
the current space in the refrigerator can only contain at most 4 cans of 'coke'.
you cannot purchase any can of 'coke' unless there is an empty slot in the refrigerator.
you cannot drink 'coke' if there is none.
write the pseudo-code using semaphores (wait() and signal()) to solve the synchornization problem.]
I am also trying to understand semaphores from the book 'operating system concepts by Silberschatz, Galvin & Gagne', albeit with difficulty.
Anyone glad to help? or perhaps provide simpler insights to semaphores?
Thank You very much.
this post is pertaining to my attempt in understanding semaphores through a given scenerio.
[you are sharing a small refrigerator with two roommates.
the current space in the refrigerator can only contain at most 4 cans of 'coke'.
you cannot purchase any can of 'coke' unless there is an empty slot in the refrigerator.
you cannot drink 'coke' if there is none.
write the pseudo-code using semaphores (wait() and signal()) to solve the synchornization problem.]
I am also trying to understand semaphores from the book 'operating system concepts by Silberschatz, Galvin & Gagne', albeit with difficulty.
Anyone glad to help? or perhaps provide simpler insights to semaphores?
Thank You very much.