Jeroen Demeyer <j.deme...@ugent.be> added the comment:

> Unpacking the int would mean having one sig_atomic_t for 'invalid', using 
> that instead of INVALID_FD, plus an array of sig_atomic_t for the fd itself.  
> Every time you want to change the fd you first set the 'invalid' flag, then 
> the individual bytes, then clear 'invalid'.

I'm not sure that this is thread-safe as processors can reorder instructions, 
so there is no guarantee that memory is written in the expected order. That's 
one of the problems that C11/C++11 atomics solve.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue1583>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to