Il 18/04/2014 10:29, Alex Bligh ha scritto:
I suspect the easiest fix (certainly for debug purposes) would be to make all
polls for non-zero time at least 10ms long. IE after the assignment of 'ms',
do something like

#ifdef BROKEN_POLL
    if (ms < 10) {
        ms = 10;
#endif
    }

If you're actually saying g_poll has 10 millisecond resolution, or rounds down,
then the appropriate course of action would be to change the rounding line to

    ms = (ns + 10*SCALE_MS - 1) / (10*SCALE_MS);

where g_poll is broken like this.

As I say, I have no Windows box to test this on, but I hope that's helpful.

Unfortunately that would probably break guests.

Windows's default poll resolution is indeed around 10 ms, and that's where glib comes from. But it can be lowered with timeBeginPeriod and timeEndPeriod, which is what QEMU does (note: the functions are basically nops with WINE, but if you remove them things actually break on Windows).

But it's unlikely that glib will change their code, which also makes sense in the common case where you don't call timeBeginPeriod/timeEndPeriod. So I think Stanislav's patch makes sense.

Paolo

Reply via email to