This is an extension to my previous question
How does blocking mode in unix/linux sockets works?
What I gather from Internet now, all the process invoking bl
If in the use case of your application, context switching would be more expensive than eating a few CPU cycles because your condition would be guaranteed to get satisfied within a short time, then busy waiting may be good for you.
Otherwise, you can forcefully relinquish the CPU by sleeping or cond_wait()ing.
Another scenario that I can think of for forceful context switching out is as follows:
while(condition)
sleep(0);