[PLUG] pthreads starvation or blocking issue

website reader website.reader3 at gmail.com
Fri Mar 22 21:22:10 UTC 2013


I have 3 programs, each one uses one pthread, containing a delay loop,
using the nanosleep() call.  At the end of the loop, a line of output
is written to a file.  The programs work great when they are the only
user tasks running on the system (which is a 12 core Intel Core I7
Extreme X 990 running 3.47 Ghz)

However, despite putting the pthread programs at -10 nice priority,
whenever I do other user tasks on the computer, even if I set those
tasks at a +10 priority, strange hold ups occur and it seems like the
pthread was put to sleep, sometimes for up to 1 second before
execution resumes, which is an incredible delay when compared to the
processor's sub-nanosecond clock cycle and this system's computing
capacity.

Is there any way of making sure that the pthreads don't suspend?  Get
a RT linux OS ?

Can pthreads be made non-blockable?  The pthreads need to be reliable
for about an 8 hour run and must keep a reliable time delay without
gaps occurring.

Randall



More information about the PLUG mailing list