> 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 
> semaphore, and with that comes added complexity.
> 
> The `eventfd` that I was suggesting be added would in my mind look something 
> more like this:
> 
> `eventfd`:
> - `__init__(...)`
> - `read(...)`
> - `write(...)`
> - `close(...)`
> - `closed(...)`
> - `fileno(...)`
> + some extra dunder methods
> 
> We could possibly add a method to get the flags that were passed to 
> `__init__`, and I think pickling should be disabled (while it does get 
> inherited through `fork(2)` and likely through `execve(2)` depending on 
> flags, I think the fd's integer value in each process can be different, 
> though I could be wrong here). 
> 
>> From that, one could then build more complex classes, 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?

Agreed the PyPi version is not worth investing in.

Do you see this as add eventfd as os.eventfd? Add definitons for the flags and 
that is it?

Turning that into a semaphore would then be easy to do on top of that os.eventf 
call.

You could even do the eventfd PoC using ctypes.

Barry



> 
> doodspav
> _______________________________________________
> 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/62XBNINQ5HCUQVGJ6UZX4PM67QRYECUA/
> Code of Conduct: http://python.org/psf/codeofconduct/
> 
_______________________________________________
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/SXIMOQW2IFVK7OZAPWWP2TQFW6X4VSVV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to