posix pipe as a work queue
问题 The normal implementations of a work queue I have seen involve mutexes and condition variables. Consumer: A) Acquires Lock B) While Queue empty Wait on Condition Variable (thus suspending thread and releasing lock) C) Work object retrieved from queue D) Lock is released E) Do Work F) GOTO A Producer: A) Acquires Lock B) Work is added to queue C) condition variable is signaled (potentially releasing worker) D) Lock is released I have been browsing some code and I saw an implementation using