[Python-ideas] PyLong_{As,From}ByteArray

2020-06-19 Thread doodspav
Unless I've misunderstood this API, and the `ByteArray` part doesn't refer to an array of bytes representing the value of `PyLong` in 2's complement, can we implement this in the public header? It's already available, it's just not exported (at least I can't use it, and it's not in the documenta

[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 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'

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

2020-06-16 Thread doodspav
but the base primitive >should be as simple as possible. Instead of trying to fix the PyPi version, I can write a proof of concept of what I described above? doodspav ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] EVENTFD(2) support

2020-06-16 Thread doodspav
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 said platform that can block on normal threads, and be aw