From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NpLRG-00027t-3H for qemu-devel@nongnu.org; Wed, 10 Mar 2010 07:55:02 -0500 Received: from [199.232.76.173] (port=35094 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NpLRF-00027l-IT for qemu-devel@nongnu.org; Wed, 10 Mar 2010 07:55:01 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NpLRD-00013O-H9 for qemu-devel@nongnu.org; Wed, 10 Mar 2010 07:55:01 -0500 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:58441 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NpLRD-000130-3u for qemu-devel@nongnu.org; Wed, 10 Mar 2010 07:54:59 -0500 Date: Wed, 10 Mar 2010 15:54:41 +0300 (MSK) From: malc In-Reply-To: Message-ID: References: <4f197c437a4d2f813ce518b4fd2d86fc225f500e.1268214633.git.quintela@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: [Qemu-devel] Re: [PATCH 01/14] Convert io handlers to QLIST List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Wed, 10 Mar 2010, Juan Quintela wrote: > malc wrote: > > On Wed, 10 Mar 2010, Juan Quintela wrote: > > > >> malc wrote: > >> > On Wed, 10 Mar 2010, Juan Quintela wrote: > >> > >> >> - for(ioh = first_io_handler; ioh != NULL; ioh = ioh->next) { > >> >> + QTAILQ_FOREACH(ioh, &io_handlers, next) { > >> >> if (ioh->fd == fd) > >> >> goto found; > >> >> } > >> >> ioh = qemu_mallocz(sizeof(IOHandlerRecord)); > >> >> - ioh->next = first_io_handler; > >> >> - first_io_handler = ioh; > >> >> + QTAILQ_INSERT_TAIL(&io_handlers, ioh, next); > >> > > >> > The old code inserted at the head, didn't it? > >> > >> Sorry, you are right, it shouldn't matter too much, but it is a change. > > > > If it did, why queue instead of list? > > Arbitrary. Example conversion nearer was QTAIL. Please do `man 3 queue'. Specifically the comparison between the tail queues and lists. > > Use is: > - insert at the beggining > - search for removal > - loop all list > > insert/searchs should be less than loops. I am more > interested/intrigued if setting more fd's in the select call could > change behaviour. > > Changing to QLIST is search/replace, no big deal. > > >> > >> Later, Juan. > >> > -- mailto:av1474@comtv.ru