bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libvirt] mingw: test-poll pipe part fails


From: Eric Blake
Subject: Re: [libvirt] mingw: test-poll pipe part fails
Date: Tue, 19 Jul 2011 09:31:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11

On 07/19/2011 09:30 AM, Daniel P. Berrange wrote:
I'm wondering if the problem here is that libvirt is trying to use the
pipe-to-self mechanism as a fundamental event loop idiom.  That is, the
reason libvirt is calling poll is in order to minimize CPU until
something interesting happens, where interesting includes needing to
wake up a helper thread to do an action inside locks in response to the
receipt of a signal.

Maybe you are on to something, and replacing all uses of pipe() with
virPipeToSelf() (which uses pipe() for efficiency on Linux, but
socketpair() on mingw), would allow libvirt to continue to use the
pipe-to-self idiom while also using fds that can actually be poll'd on
mingw.

IIRC, we never resolved this for the last release. I think we should
do as you suggest and just use socketpair() on Win32. Given the way
in which libvirt uses these capabilities, I don't think the overheads
of socketpair() vs pipe() are so onerous that we need worry about an
even more fancy Win32 impl or eventfd for linux. Of course if someone
wants todo a full job for gnulib meawhile, we won't complain...

Well, right now, we don't even have socketpair() for Win32. We'd have to wire up some other native APIs for this to work.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]