From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KM244-0002L5-DH for qemu-devel@nongnu.org; Thu, 24 Jul 2008 10:45:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KM242-0002Hh-Cv for qemu-devel@nongnu.org; Thu, 24 Jul 2008 10:45:07 -0400 Received: from [199.232.76.173] (port=53585 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KM242-0002HI-3d for qemu-devel@nongnu.org; Thu, 24 Jul 2008 10:45:06 -0400 Received: from mail2.shareable.org ([80.68.89.115]:59564) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KM242-0001mm-4W for qemu-devel@nongnu.org; Thu, 24 Jul 2008 10:45:06 -0400 Date: Thu, 24 Jul 2008 16:07:19 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd. Message-ID: <20080724150718.GA17248@shareable.org> References: <20080723082413.GA2291@redhat.com> <48871A7E.5030501@redhat.com> <20080723121510.GJ2291@redhat.com> <48872979.4050107@redhat.com> <48873F17.4030101@redhat.com> <48874D4A.8000604@codemonkey.ws> <48875849.60200@redhat.com> <48875CEE.6000906@codemonkey.ws> <20080724083553.GC1138@redhat.com> <4888905F.3030404@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4888905F.3030404@codemonkey.ws> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Anthony Liguori wrote: > >The only guarenteed reliable way I know of is using epoll(), but as I > >mentioned before that's Linux specific, so not immediately useful unless > >we're willing to drop in an alternate epoll() based main loop for Linux > >only, and say other OS have to use PTYs in blocking mode. > > > > So far, this sounds like the best option to me. I'm surprised it works. You shouldn't be able to get any more information out of epoll() than poll() - they're supposed to be exactly equivalent informationally, except for details and performance. Which suggests to me if it works now, it might get... fixed. So what are you doing with epoll + pty that works? Btw, you don't need an epoll main loop. You can just put the pty into epoll, and put the _epoll_'s file descriptor into the main loop. You'll get a ready-to-read when there's a message from epoll. epoll supports its descriptor being used by other pollers, even another epoll. -- Jamie