Date: Mon, 1 Feb 1999 13:09:51 +0100 From: Ladavac Marino <mladavac@metropolitan.at> To: "'Sergey S. Kosyakov'" <ks@osi.ru>, Terry Lambert <tlambert@primenet.com> Cc: freebsd-hackers@FreeBSD.ORG Subject: RE: select and threads again Message-ID: <97A8CA5BF490D211A94F0000F6C2E55D09752C@s-lmh-wi-900.corpnet.at>
next in thread | raw e-mail | index | archive | help
> -----Original Message----- > From: Sergey S. Kosyakov [SMTP:ks@osi.ru] > Sent: Monday, February 01, 1999 7:00 AM > To: Terry Lambert > Cc: freebsd-hackers@FreeBSD.ORG > Subject: Re: select and threads again > > > Thank you for detailed information. > > There was no write selecting at all (I guess), but was exceptional > conditions > selecting. The socketpair() fails in the same manner. I will try > AF_INET socket > later, because it is needed to make much more changes in ILU code. > [ML] Isn't an exception only generated for Out-Of-Band data? Can you have these messages in a pipe at all? (sorry, no manpages nor sources here-- a lamentable NT box: lack of Token Ring support in FreeBSD, and I am not allowed to use the corporate network for driver development :( /marino > Sergey > > On 30-Jan-99 Terry Lambert wrote: > > > > The real non-libc_r wrapped select is supposed to be called by the > > wrapping select using a zero valued timeval struct (effecting a > "poll") > > when there are other threads ready to run. > > > > When all threads are blocked pending I/O on fd's, then a real select > is > > called on all of the fd's on which I/O is pending with a NULL > pointer > > instead of a zero valued timeval struct. This makes the select hang > > until I/O is available on one or more of the fd's. > > > > If you are getting a blocking select, then the only possible cause > > is that the scheduler believes that there are no other threads in > > a read-to-run state, and therefore makes the blocking call instead > > of call converting it to a polling call which, if not input is > > pending, is followed by a threads context switch. > > > > > > Perhaps you are both read and write selecting the pipe fd, in two > > seperate threads? > > > > In general, write selecting is a bad idea. > > > > This may be a problem in the pipe code, or in the wrapping function > > in libc_r (unlikely). > > > > You could try using a POSIX domain socket instead of a pipe; it uses > > the same underlying code (man socketpair). If this also hangs, try > > using a real socket (AF_INET instead of AF_UNIX). > > > > Also, make sure you are not using fork(), since it interacts badly > > with threads. > > > > > > Terry Lambert > > terry@lambert.org > > --- > > Any opinions in this posting are my own and not those of my present > > or previous employers. > > --- > ---------------------------------- > E-Mail: Sergey S. Kosyakov <ks@osi.ru> > Date: 01-Feb-99 > Time: 08:44:42 > ---------------------------------- > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?97A8CA5BF490D211A94F0000F6C2E55D09752C>