I am trying to tell one thread that it's ok to continue with calculations after the other thread reads data from a named pipe. Currently, I have a while infinite loop which checks everytime for new data. But this is inefficient as it consumes 100% of the CPU... 

My question is... Is there any way to wait until one thread has checked for new data and tell the other thread that it's ok to continue (something like a signal)?