Is a binary semaphore needed for synchronization of a counting semaphore? -


my professor says if have counting semaphore (specifically, system v semaphore), there can synchronization problems if 2 processes try access semaphore @ same time, need mediate access counting semaphore separate binary semaphore.

i thought whole point of semaphores if 2 process try access semaphore @ same time, kernel automatically synchronizes access. true?

yes system v semaphores adjusted atomically , access them thread safe without further semaphore. isn't atomic creation , initialisation of semaphore must done before processes try access , adjust it.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -