On 16/06/2020 07.56, doods...@gmail.com wrote:
> Can we implement eventfd(2) as documented here 
> <https://man7.org/linux/man-pages/man2/eventfd.2.html>?
> 
> It would only be available on the Linux platform, and one of the benefits 
> would be the ability to create synchronisation primitives on said platform 
> that can block on normal threads, and be awaited on in coroutines (without 
> busy looping inside said coroutine).
> 
> Currently the best place I can think of to put it would be in one of the 
> Networking and Interprocess Communication modules (possibly `select` or 
> `socket`?). The fact that it's Linux only shouldn't be an issue, since much 
> of the contents of `select` is OS dependent.

We usually expose low-level, file descriptor-related functions in the os
module and then provide high-level wrappers in Python. The approach is
most flexible and allows 3rd parties to build on top of the raw file
descriptor, too.

I opened a BPO and created https://github.com/python/cpython/pull/20930
to implement a low-level interface to glibc's eventfd() function.

Christian
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BC7ZRPW5D7UCDGVKRJWD2GFUYWL2UHZB/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to