Date: Fri, 1 Mar 2002 13:52:26 -0800 (PST) From: Julian Elischer <julian@elischer.org> To: Matthew Dillon <dillon@apollo.backplane.com> Cc: Alfred Perlstein <bright@mu.org>, smp@FreeBSD.ORG, dillon@FreeBSD.ORG, jhb@FreeBSD.ORG, Chad David <davidc@acns.ab.ca> Subject: Re: select/poll locking wrong? Message-ID: <Pine.BSF.4.21.0203011349010.12215-100000@InterJet.elischer.org> In-Reply-To: <200203010441.g214fUT41077@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Feb 2002, Matthew Dillon wrote: > :> > :> The cache appears to be there so select(), when it is getting ready > :> to return, can avoid traversing the list and removing the events that > :> have not occured. This results in a potentially stale si_pid because > :> now the process can exit without doing any further cleanups. > : > :Yes, this is why we must now walk the list when leaving select/poll. > : > :.. > :Anyhow, hope that clarifies. Any other ideas or improvements? > : > :Any idea on how we can avoid the list traversal at the end of > :select? > : > :-- > :-Alfred Perlstein [alfred@freebsd.org] > > Walking the whole list is one solution. Another would be to link > selinfo into a thread-based list (the thread it has been asigned to) > and just walk *that* list on exit in order to avoid having to lock > the entire descriptor list on every select(). I'm still not sure > which of these two approaches you are going for. > > I'm not sure how this would tie into KSE. It might not be efficient > to walk the list on thread-exit since KSE creates and drops threads > all the time. I need to add a generation number to threads. And possibly a TID (like PID) (maybe the same thing?) The TID would be just an incrementing number taken from a field in the proc. thus the full TID would be PID:TID It hasn't been needed yet, but I can see it coming.. > > -Matt > Matthew Dillon > <dillon@backplane.com> > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-smp" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0203011349010.12215-100000>