Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

All the simple programs have been written.


devel / comp.lang.python / Re: Calling pselect/ppoll/epoll_pwait

SubjectAuthor
o Re: Calling pselect/ppoll/epoll_pwaitBarry

1
Re: Calling pselect/ppoll/epoll_pwait

<mailman.1087.1670147743.20444.python-list@python.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=24943&group=comp.lang.python#24943

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: Calling pselect/ppoll/epoll_pwait
Date: Sun, 4 Dec 2022 09:55:24 +0000
Lines: 85
Message-ID: <mailman.1087.1670147743.20444.python-list@python.org>
References: <SA1PR14MB5855D7381437C77B03B1F42CB9169@SA1PR14MB5855.namprd14.prod.outlook.com>
<1735D724-0AEF-4FE9-8C92-86FA5041DDDC@barrys-emacs.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="utf-8"
X-Trace: news.uni-berlin.de z4ugB7e30fyT7C7JJSRqUQcp0G3YX4QY/z2QVDu6CgrQ==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'url-ip:140.82/16': 0.03;
'(e.g.': 0.05; '(for': 0.05; '2022': 0.05; 'codes': 0.07; 'cc:addr
:python-list': 0.09; 'example:': 0.09; 'from:addr:barry': 0.09;
'received:217.70': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; '&gt;': 0.14; 'cc:no real
name:2**0': 0.14; 'url:github': 0.14; 'url:mailman': 0.15; 'url-
ip:140/8': 0.15; '***': 0.16; '2022,': 0.16; '7:02': 0.16;
'barry': 0.16; 'concurrency': 0.16; 'expose': 0.16; 'from:addr
:barrys-emacs.org': 0.16; 'gil': 0.16; 'message-id:@barrys-
emacs.org': 0.16; 'modules,': 0.16; 'researching': 0.16; 'turns':
0.16; 'url:urldefense': 0.16; 'url:v3': 0.16; 'wrote:': 0.16;
'python': 0.16; 'probably': 0.17; 'cc:addr:python.org': 0.20;
'cc:2**1': 0.23; 'url:listinfo': 0.25; 'seems': 0.26; 'friday,':
0.26; 'library': 0.26; 'opening': 0.26; 'function': 0.27; 'email
addr:python.org&gt;': 0.28; 'dec': 0.31; 'assume': 0.32; 'python-
list': 0.32; 'signal': 0.32; 'but': 0.32; 'header:In-Reply-To:1':
0.34; 'couple': 0.37; 'using': 0.37; 'way': 0.38; 'could': 0.38;
'means': 0.38; 'read': 0.38; 'ago': 0.39; 'date:': 0.39; 'use':
0.39; 'appears': 0.40; 'lack': 0.60; 'provide': 0.60; 'email.':
0.61; 'from:': 0.62; 'to:': 0.62; 're:': 0.64; 'your': 0.64;
'dedicated': 0.65; 'years': 0.65; '[1]': 0.67; 'received:217':
0.67; 'cc:': 0.69; 'url-ip:52.6/16': 0.69; '[2]': 0.70;
'conditions': 0.70; 'clicking': 0.76; 'links.': 0.81;
'attention:': 0.84; 'email name:&lt;python-list': 0.84; 'signal.':
0.84; 'skip:& 50': 0.84; 'skip:= 70': 0.84; 'meets': 0.91;
'trick': 0.91; 'race': 0.93
In-Reply-To: <SA1PR14MB5855D7381437C77B03B1F42CB9169@SA1PR14MB5855.namprd14.prod.outlook.com>
X-Mailer: iPad Mail (20B101)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <1735D724-0AEF-4FE9-8C92-86FA5041DDDC@barrys-emacs.org>
X-Mailman-Original-References: <SA1PR14MB5855D7381437C77B03B1F42CB9169@SA1PR14MB5855.namprd14.prod.outlook.com>
 by: Barry - Sun, 4 Dec 2022 09:55 UTC

On 3 Dec 2022, at 13:13, Weatherby,Gerard <gweatherby@uchc.edu> wrote:



Signalfd and select could probably be made to work if one codes around
the race conditions pselect is provided to avoid. I’m not sure if using
the GIL (for CPython) is sufficient or if a dedicated concurrency
control (e.g. lock, mutex, semaphore) is necessary.

An alternative is to call the C library function via a wrapper. I had
need to use setfsuid on a project a couple of years ago and found this
example:

[1]https://gist.github.com/atdt/ebafa299e843a767139b

 

I read this on SO when researching your question.
Search for epoll and signal.

(I would post the link but ipad turns the link into an image…)

I assume that the lack of pepoll means you can use epoll and

signalfd without race conditions. The trick seems to be setting

the signal to ignore.

Barry

 

From: Python-list <python-list-bounces+gweatherby=uchc.edu@python.org>
on behalf of Barry <barry@barrys-emacs.org>

Date: Friday, December 2, 2022 at 7:02 PM
To: Ian Pilcher <arequipeno@gmail.com>
Cc: python-list@python.org <python-list@python.org>
Subject: Re: Calling pselect/ppoll/epoll_pwait

*** Attention: This is an external email. Use caution responding,
opening attachments or clicking on links. ***

> On 2 Dec 2022, at 20:03, Ian Pilcher <arequipeno@gmail.com> wrote:
>
> Does Python provide any way to call the "p" variants of the I/O
> multiplexing functions?
>
> Looking at the documentation of the select[1] and selectors[2]
modules,
> it appears that they expose only the "non-p" variants.
>
> [1]
[2]https://urldefense.com/v3/__https://docs.python.org/3/library/select.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_OD5qBjeA$
> [2]
[3]https://urldefense.com/v3/__https://docs.python.org/3/library/selectors.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_MwNjgO8A$

Can you use signalfd and select/poll/epoll?

Barry

>
> --
>
========================================================================
> Google                                      Where SkyNet meets
Idiocracy
>
========================================================================
> --
>
[4]https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$
>

--
[5]https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$

References

Visible links
1. https://gist.github.com/atdt/ebafa299e843a767139b
2. https://urldefense.com/v3/__https:/docs.python.org/3/library/select.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_OD5qBjeA$
3. https://urldefense.com/v3/__https:/docs.python.org/3/library/selectors.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_MwNjgO8A$
4. https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$
5. https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$


devel / comp.lang.python / Re: Calling pselect/ppoll/epoll_pwait

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor