View Single Post
Old 05-14-03, 09:57 AM   #3
Registered User
Join Date: May 2003
Posts: 4
Default polling also doesn't sync well

In fact we are using pthreads, and in a preemtive configuration. Of course while the first thread is doing the polling, it's possible that other threads take the control of the CPU, but some comments on this:

If the draw thread is heavily using the CPU and the other too, the other will have ideally only half of the CPU time it could have (while SwapBuffers). So our app could be faster than it is.

Moreover, while the draw thread is polling for the retrace, it's possible that the sheduler gives the CPU to the second thread (or even another process), and when the draw thread recovers the CPU, it could be too late.
So how can it guarantee to be in time even doing "busy wait"? In fact, the driver in our machine is not syncing the swap buffers with vertical retrace correctly (even though it is eating all CPU available).

There is a possibility of changing the HZ constant of the kernel, or use a 2.5 kernel for our app. But I think it will not solve any of the problems we have.
epoh is offline   Reply With Quote