我被问到以下问题,我不确定正确答案是什么:
If monitors are implemented by replacing condition variables with semaphores
(counters set to 0) with down() and up() as wait and signal, respectively,
would the monitors work correctly?
我很想说这是一个正确的实现,因为信号量和条件变量可以相互替换,对吗?有更好的解释吗?