[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 01/14] Convert io handlers to QLIST
From: |
malc |
Subject: |
[Qemu-devel] Re: [PATCH 01/14] Convert io handlers to QLIST |
Date: |
Wed, 10 Mar 2010 15:54:41 +0300 (MSK) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
On Wed, 10 Mar 2010, Juan Quintela wrote:
> malc <address@hidden> wrote:
> > On Wed, 10 Mar 2010, Juan Quintela wrote:
> >
> >> malc <address@hidden> 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:address@hidden
[Qemu-devel] [PATCH 02/14] remove useless cast, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 03/14] rename IOCanRWHandler to IOCanReadHandler, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 04/14] bt: remove bt_host_read_poll(), Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 05/14] Handle deleted IOHandlers in a single pass, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 07/14] qemu-char:stdio insert poll call into read one, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 08/14] qemu-char:tcp insert poll call into read one, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 06/14] tap: insert tap_can_send() into tap_send(), Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 09/14] qemu-char:fd insert poll call into read one, Juan Quintela, 2010/03/10
[Qemu-devel] [PATCH 10/14] qemu-char:pty insert poll call into read one, Juan Quintela, 2010/03/10