[Python-ideas] Simpler thread synchronization using "Sticky Condition"

Richard Whitehead richard.whitehead at ieee.org
Wed Mar 27 05:43:45 EDT 2019


Thank you everyone who has commented on this issue, I've been overwhelmed by the helpfulness and thoughtfulness of the responses.

In summary: 
* Condition variables work without problems provided you use them correctly, but using them correctly is quite tricky. 
* Using an event to achieve the same thing is trivially easy.
* Having the event auto-resetting isn't even necessary.

My conclusions:
* The very simplest client code, which is almost impossible to get wrong or for someone else to mess up during maintenance, uses an auto-resetting event, and so that's what I'm going to do. 
* It doesn't sound like there is any appetite for this auto-reset-event to be part of the Python standard library, so I'm not going to push for a PEP to be raised on it, but I will certainly use it in my company's base library code.

Thanks again,

Richard



More information about the Python-ideas mailing list