ansible.plugins.strategy.StrategyBase._results_lock is acquired to control 
access to StrategyBase._results and StrategyBase._handler_results. 
Specifically

- in ansible.plugins.strategy.results_thread_main() before append() ing a 
result
- in StrategyBase_process_pending_results() before popleft() ing

However StrategyBase._results & _handler_results are both collections.deque 
objects. From the Python docs

> Deques support thread-safe, memory efficient appends and pops from either 
side of the deque.

Thus AFAICT the lock isn't needed for the deque operations, and could 
possibly be removed. Have I missed something? Is the lock providing another 
protection I've not noticed? Is it there as a belt and braces measure?

If there's no  reason to have it, and interest in removing it, I'll submit 
a PR. Alternatively maybe there's benefit in keeping the lock and using 
wait()/notify() instead of some of the polling.

Regards, Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/3a309938-189d-4b8b-b9c4-539afea81984n%40googlegroups.com.

Reply via email to