diff --git a/Concurrent Systems/notes/4 - Semaphores.md b/Concurrent Systems/notes/4 - Semaphores.md index bb235c8..7539e67 100644 --- a/Concurrent Systems/notes/4 - Semaphores.md +++ b/Concurrent Systems/notes/4 - Semaphores.md @@ -1 +1,8 @@ -A Semaphore is an object with \ No newline at end of file +**Object:** entity with an implementation (hidden) and an interface (visible), made up of a set of operations and a specification of the behavior. +**Concurrent:** if the object can be accessed by different processes. + +**Semaphore:** is a shared counter S accessed via primitives $up$ and $down$ s.t.: +- is initialized at s0 >= 0 +- it is alwayz >= 0 +- up atomically increases S +- down atomically decreases S if it is not 0, otherwise the proce \ No newline at end of file