Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 1999 16:59:40 +0300 (MSK)
From:      "Sergey S. Kosyakov" <ks@itp.ac.ru>
To:        John Birrell <jb@cimlogic.com.au>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: select and threads again
Message-ID:  <XFMail.990129165940.ks@itp.ac.ru>
In-Reply-To: <199901290814.TAA13146@cimlogic.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help

Finally I found why select hangs. In multithread mode ILU uses pipe()
for "communicational channel" between threads. So each select actually is
waiting on two FD - first is the socket and second is the pipe. I don't know
why in that situation select hangs forever. If I force select to wait only on
single socket, then it works. I guess there are still some restrictions for
select in multithread environment.

On 29-Jan-99 John Birrell wrote:
> Sergey S. Kosyakov wrote:
>> Thank you for your quick answer. But there is problem with ILU I trying to
>> solve. For each operation on each TCP socket ILU starts new thread, which
>> inturn calls select(). I trace this processes and found that if two threads
>> in
>> the same time calls select (with timeout=infinity) on different sockets that
>> only the last thread stays operational. The first thread hangs forever on
>> select(). May be there are some underwater stones? I compile and link ILU
>> with
>> "cc -g -pthread", nothing more.
> 
> I have applications (including one I'm working on) that do this a *lot*.
> It works for me.
> 
> -- 
> John Birrell - jb@cimlogic.com.au; jb@freebsd.org http://www.cimlogic.com.au/
> CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137

---
----------------------------------
Sergey Kosyakov
Laboratory of Distributed Computing
Department of High-Performance Computing and Applied Network Research
Landau Institute for Theoretical Physics
E-Mail: ks@itp.ac.ru
Date: 29-Jan-99
Time: 16:48:40
----------------------------------
---

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?XFMail.990129165940.ks>