[Python-ideas] Re: EVENTFD(2) support

2020-06-18 Thread Barry Scott
> On 16 Jun 2020, at 19:57, doods...@gmail.com wrote: > > I've looked over the PyPi version of `eventfd`, and I feel that it is trying > to be more than just a thin wrapper. The attempt to make it cross platform > has given it more fields than it requires, as has the attempt to wrap it as a

[Python-ideas] Re: EVENTFD(2) support

2020-06-17 Thread Kyle Stanley
> Perfect. What's the procedure now for getting that PR accepted? Next, it will go through a PR review process prior to being included for Python 3.10. Since it's being implemented as a wrapper for an existing OS API, a PR and bpo issue should be adequate (as opposed to major change proposals that

[Python-ideas] Re: EVENTFD(2) support

2020-06-17 Thread doodspav
> I opened a BPO and created https://github.com/python/cpython/pull/20930 > to implement a low-level interface to glibc's eventfd() function. Perfect. What's the procedure now for getting that PR accepted? ___ Python-ideas mailing list -- python-ideas@py

[Python-ideas] Re: EVENTFD(2) support

2020-06-17 Thread Christian Heimes
On 16/06/2020 07.56, doods...@gmail.com wrote: > Can we implement eventfd(2) as documented here > ? > > It would only be available on the Linux platform, and one of the benefits > would be the ability to create synchronisation primitives on s

[Python-ideas] Re: EVENTFD(2) support

2020-06-17 Thread doodspav
This is my first attempt at a C implementation: https://gist.github.com/doodspav/5d96c09696fa3ef1c89b4d6426ddc338 It stores the `fd` as an atomic int, since I think threads not being able to run in parallel is an implementation detail, and I shouldn't be designing code around it? I'm not sure i

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Kyle Stanley
> Instead of trying to fix the PyPi version, I can write a proof of concept of what I described above? That would definitely be useful, and would help us get a more solid idea of what exactly is being proposed. I also agree that a potential version contained in the select module should be as simpl

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread doodspav
I've looked over the PyPi version of `eventfd`, and I feel that it is trying to be more than just a thin wrapper. The attempt to make it cross platform has given it more fields than it requires, as has the attempt to wrap it as a semaphore, and with that comes added complexity. The `eventfd` th

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Jonathan Fine
Hi As said earlier, it's on PyPi: https://pypi.org/project/eventfd/ However, it's only at version 0.2 and hasn't been changed since 2016. Digging a bit deeper, there's an unresolved issue that suggests more work is required. Issue: Race condition in "set" can lead to a bad state https://github.c

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Kyle Stanley
> 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). +1. Although it already exists as a

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Rhodri James
On 16/06/2020 06:56, doods...@gmail.com wrote: Can we implement eventfd(2) as documented here ? EventFD is available on PyPI: https://pypi.org/project/eventfd/ -- Rhodri James *-* Kynesim Ltd ___