我有兩個過程:在MacOSX上,在C++中,如何在沒有自旋鎖的情況下通過共享內存進行進程間通信?
Producer
and
Consumer
他們的記憶
Memory
常用mmaped共享區域現在,製片人寫的東西記憶。消費者從內存中讀取內容。
I would prefer Consumer not to spin wait with Memory is empty.
I would prefer Producer not to spin wait when Memory is full.
我該如何做到這一點?