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)?
There are various solutions for your problem:
Have a look at them and find the one that fits the best for you.
Qt拥有您想要的一切,QThread可与信号和插槽配合使用。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.