Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #97951

Re: select.poll and ppoll

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Marko Rauhamaa <marko@pacujo.net>
Newsgroups comp.lang.python
Subject Re: select.poll and ppoll
Date Sun, 25 Oct 2015 21:21:48 +0200
Organization A noiseless patient Spider
Lines 17
Message-ID <87pp02da9f.fsf@elektro.pacujo.net> (permalink)
References <56287672$0$11117$c3e8da3@news.astraweb.com> <87eggnqhgq.fsf@elektro.pacujo.net> <562cbd56$0$1598$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="19176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19A4nFd/tmb+nbaMwMIjoEf"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Cancel-Lock sha1:pRiQEkFnSXSAVyfEAOI+h/K4GKg= sha1:X1+JkB2btIqWVYvWGf34AIW0Fqg=
Xref csiph.com comp.lang.python:97951

Show key headers only | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info>:

> On Thursday 22 October 2015 22:18, Marko Rauhamaa wrote:
>> The standard, classic way to solve the race condition is to replace
>> the "signaled" flag with an internal pipe. The signal handler writes
>> a byte into the pipe and select.poll() wakes up when the pipe becomes
>> readable. IOW, ppoll() and pselect() are not needed.
>
> [...]
>
> I will discuss with my colleague and see if this solves his problem.

Note also that "newer" Linux kernels (2.6.25 and up) have a file
descriptor type, signalfd, that simplifies the idiom slightly.


Marko

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

select.poll and ppoll Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-10-22 16:38 +1100
  Re: select.poll and ppoll Paul Rubin <no.email@nospam.invalid> - 2015-10-22 00:30 -0700
  Re: select.poll and ppoll Laura Creighton <lac@openend.se> - 2015-10-22 11:07 +0200
  Re: select.poll and ppoll Marko Rauhamaa <marko@pacujo.net> - 2015-10-22 14:18 +0300
    Re: select.poll and ppoll Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-10-25 22:30 +1100
      Re: select.poll and ppoll Marko Rauhamaa <marko@pacujo.net> - 2015-10-25 21:21 +0200
        Re: select.poll and ppoll Marko Rauhamaa <marko@pacujo.net> - 2015-10-25 21:23 +0200

csiph-web