Counting Barrier - Georgia Tech - Advanced Operating Systems

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

I think that potential deadlock is the main problem with these approaches. Let's say that all threads waiting for count to be zero have been preempted for some reason. If the last thread decrements the count and sets count = N, the preempted threads when woken up will still be waiting for the count to become zero. This is a deadlock situation.

sanketitnal
Автор

why not remove the while(count > 0) spin ?? It will still work i suppose, and we will have only 1 spin.

abhayshukla