I'm using C++ in Linux to read UDP and TCP sockets. I am now trying to impliment multithreading using pthreads.
pthreads has forced me to replace many of the standard socket functions (select, sleep, send, etc) with "pth_" replacements (i.e. pth_select, etc).
Problem is that pth_select isn't blocking. I.e. it isn't waiting for something to come over the sockets, it's simply checking the sockets then continuing. Sort of like what would happen if the time-to-wait before timing out was set to zero.
Thus I'm using all my CPUs to simply run around a while loop constantly checking the sockets.
This code worked fine before pthreads and pth.h was introduced, i.e. I'm confident that I actually have a wait time defined because it was waiting before.
Any help or directions to help would be very welcome. Thank you in advance.
pthreads has forced me to replace many of the standard socket functions (select, sleep, send, etc) with "pth_" replacements (i.e. pth_select, etc).
Problem is that pth_select isn't blocking. I.e. it isn't waiting for something to come over the sockets, it's simply checking the sockets then continuing. Sort of like what would happen if the time-to-wait before timing out was set to zero.
Thus I'm using all my CPUs to simply run around a while loop constantly checking the sockets.
This code worked fine before pthreads and pth.h was introduced, i.e. I'm confident that I actually have a wait time defined because it was waiting before.
Any help or directions to help would be very welcome. Thank you in advance.
Comment