From owner-freebsd-hackers Fri Jan 29 05:59:24 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA18734 for freebsd-hackers-outgoing; Fri, 29 Jan 1999 05:59:24 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from itp.ac.ru (itp.ac.ru [193.233.32.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA18728 for ; Fri, 29 Jan 1999 05:59:21 -0800 (PST) (envelope-from ks@itp.ac.ru) Received: from speecart.chg.ru (speecart.chg.ru [193.233.46.2]) by itp.ac.ru (8.9.1/8.9.1) with ESMTP id RAA09087; Fri, 29 Jan 1999 17:02:43 +0300 (MSK) Message-ID: X-Mailer: XFMail 1.2 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <199901290814.TAA13146@cimlogic.com.au> Date: Fri, 29 Jan 1999 16:59:40 +0300 (MSK) Organization: Landau Institute for Theoretical Physics From: "Sergey S. Kosyakov" To: John Birrell Subject: Re: select and threads again Cc: freebsd-hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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