In addition to select() there's also clock_nanosleep(CLOCK_MONOTONIC, 0, &tv, NULL), which in theory should give best resolution possible.
To set realtime privileges, use (taken from jack): struct sched_param rtparam; memset (&rtparam, 0, sizeof (rtparam)); rtparam.sched_priority = priority; pthread_setschedparam (thread, SCHED_FIFO, &rtparam); Interesting project, btw. I planned to start something like this myself. Please, publish results of your timing experiments - very interesting! Dmitry.
