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
Post a Comment