On 18 Apr 2014, at 10:26, Stanislav Vorobiov wrote: > Yes, it's possible to work around like this, but if we look at this: > > if (ms < 10) { > ms = 10; > } > > the question arises: where did 10 come from ? It looks like a magic number > and in fact > it is, it was taken from glib's gpoll.c. But what if tomorrow glib changes > and use, say, > 15 in gpoll.c, then we'll observe the same CPU hogging in qemu again.
Well obviously the real fix is either to fix the bug in glib, or to do what I did when I introduced ppoll, which was to conclude that the glib implementation of gpoll was inadequate and that it should be replaced locally if possible with something with microsecond, if not nanosecond, resolution (obviously nanosecond resolution itself never occurs in practice). Perhaps that's what you are trying to do and I have misunderstood. -- Alex Bligh