In general, waiting mutexes do not consume any CPU resources while they are waiting.
I need to better understand what your application is doing:
- Are the client and server collocated, i.e., in the same process?
- If not collocated, do you run them on the same host (a dual-processor machine)?
- If not collocated, how many threads do you have in the server-side thread pool?
- Are the calls to consume() oneway or twoway?
As an aside, I don't recommend to call lock() and unlock() directly. You should use one of the Lock classes instead, which lock in the constructor and unlock the the destructor. This is safer, especially with respect to exceptions.