malc <av1...@comtv.ru> wrote: > On Wed, 10 Mar 2010, Juan Quintela wrote: > >> malc <av1...@comtv.ru> 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. 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. >>