https://birrell.org/andrew/papers/ImplementingCVs.pdf
另外,C#的 Monitor.Wait和 Monitor.Pulse看起来可以用来实现CV。在这篇文章中提到了一些使用细节。看起来和 pthread_cond_wait() 的用法有点类似,都要在函数返回后重新确认producer有没有产生需要的内容,然后在必要时继续等待。
值得一提的是,在第二篇文章中,作者实际上构造出了一个简易的 AutoResetEvent 。

System.WeakReference<T>
https://birrell.org/andrew/papers/ImplementingCVs.pdf
另外,C#的 Monitor.Wait和 Monitor.Pulse看起来可以用来实现CV。在这篇文章中提到了一些使用细节。看起来和 pthread_cond_wait() 的用法有点类似,都要在函数返回后重新确认producer有没有产生需要的内容,然后在必要时继续等待。
值得一提的是,在第二篇文章中,作者实际上构造出了一个简易的 AutoResetEvent 。