1) I'm not asking how to block if the buffer is full. I'm saying that I can think of two ways to communicate with the producer thread. a) If Producer_fn returns buffer-full, then the producer thread will have to sleep for a while, and call Producer_fn once again to see if it can write or, b) producer thread must export an event handle and wait on that event handle for the consumer thread to set it when the buffer is available. This latter see-saw concept playing with event handles may not be easy to implement.

2) Who cares what the user does outside of calling your library. I do, and probably the user does as well. The idea behind providing such a mechanism (transfer the data to another thread) is not to block the first thread for lengthy operations/calculations/processings. I'm not sure if this is a good example for my case but if you code a network sniffer, not producing data may not be an option.

I wanted to hear different opinions on my concerns. I'm sure people's opinions will differ.