From owner-freebsd-hackers@FreeBSD.ORG Thu May 20 12:54:56 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06E4316A4CE for ; Thu, 20 May 2004 12:54:56 -0700 (PDT) Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9446C43D1D for ; Thu, 20 May 2004 12:54:55 -0700 (PDT) (envelope-from jose-marcio.martins@ensmp.fr) Received: from ensmp.fr (alesia-10-82-226-38-60.fbx.proxad.net [82.226.38.60]) by postfix3-2.free.fr (Postfix) with ESMTP id BB2F4C1CB for ; Thu, 20 May 2004 21:54:44 +0200 (CEST) Message-ID: <40AD0C95.9080904@ensmp.fr> Date: Thu, 20 May 2004 21:52:53 +0200 From: "Jose-Marcio.Martins@ensmp.fr" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: A problem with poll X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jose-Marcio.Martins@ensmp.fr List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 19:54:56 -0000 Hello, I'm using a pipe to communicate between threads in the same process. In fact, I've a thread waiting (using poll) for data available on some set of file descriptors. From time to time I need to interrupt the poll call in order to add a new file descriptor. I do this with the pipe. I add p[0] to the poll set and I write to p[1] when I want to interrupt the poll call. The problem is that poll returns as expected, but the read on the file descriptor blocks. Before the poll call, I set events flags to POLLIN | POLLPRI. When poll returns, events is set to POLLIN [ POLLPRI, and revents is 0. Value returned by poll is the good number of file descriptors ready. What I'm doing wrong ? Thanks for your help Joe -- --------------------------------------------------------------- Jose Marcio MARTINS DA CRUZ Tel. :(33) 01.40.51.93.41 Ecole des Mines de Paris http://j-chkmail.ensmp.fr 60, bd Saint Michel http://www.ensmp.fr/~martins 75272 - PARIS CEDEX 06 mailto:Jose-Marcio.Martins@ensmp.fr