Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 May 2004 21:52:53 +0200
From:      "Jose-Marcio.Martins@ensmp.fr" <jose-marcio.martins@ensmp.fr>
To:        freebsd-hackers@freebsd.org
Subject:   A problem with poll
Message-ID:  <40AD0C95.9080904@ensmp.fr>

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


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40AD0C95.9080904>