A problem with poll

Jose-Marcio.Martins_at_ensmp.fr
Date: 05/20/04

  • Next message: Dan Nelson: "Re: Problem with a 5.2.1 system and downloading"
    Date: Thu, 20 May 2004 21:52:53 +0200
    To: freebsd-hackers@freebsd.org
    
    

    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
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Dan Nelson: "Re: Problem with a 5.2.1 system and downloading"

    Relevant Pages

    • Re: [PATCH 2.4.33.2] enforce RLIMIT_NOFILE in poll()
      ... POSIX states that poll() shall fail with EINVAL if nfds> OPEN_MAX. ... up to 1024 file descriptors even if RLIMIT_NOFILE is less than 1024, ... Are you aware of some apps which do not work as expected ... I submitted a similar but different patch for this very same issue against ...
      (Linux-Kernel)
    • Re: [PATCH 2.4.33.2] enforce RLIMIT_NOFILE in poll()
      ... POSIX states that poll() shall fail with EINVAL if nfds> OPEN_MAX. ... up to 1024 file descriptors even if RLIMIT_NOFILE is less than 1024, ... I submitted a similar but different patch for this very same issue against the 2.6 kernel. ...
      (Linux-Kernel)
    • [PATCH 2.6.18-rc5] enforce RLIMIT_NOFILE in poll()
      ... POSIX states that poll() shall fail with EINVAL if nfds> OPEN_MAX. ... In this case, the patch changes nothing. ... RLIMIT_NOFILE file descriptors even if less than 1024 have been opened. ...
      (Linux-Kernel)
    • Re: select.poll.poll() never blocks
      ... it returned file descriptors that had registered an event that the ... Constant   Meaning ... poll() and friends are wrappers over the socket library "poll" and ... socket communications. ...
      (comp.lang.python)
    • Re: Asyncore select statement problem
      ... This function does not use a select call, but a poll call to do its ... called on a series of file descriptors that should not be changed. ... the asyncore loop haults. ... The use_poll flag sets the asyncore module ...
      (comp.lang.python)