Presumably each thread is waiting on say a socket for something interesting to happen?
My preferred way would be to use select() with a timeout if you want each thread to run every so often, even if there is no network traffic.
Presumably each thread is waiting on say a socket for something interesting to happen?
My preferred way would be to use select() with a timeout if you want each thread to run every so often, even if there is no network traffic.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
hmmm..... me even thinkin so to use select but i almost did the entire thing based on thread now have to find a way to change the existin code.....