Guido van Rossum added the comment:

Given the date from that comment I assume that I told Raymond this during the 
2016 core sprint. I can't recall that conversation but I am still pretty 
worried about using an RLock. (What if someone slightly more insane decides to 
call get() from inside a GC callback or signal handler?)

However I do think we have to do something here. It's also helpful that all 
mutable state except for unfinished_tasks is just a deque or list, and the 
_get()/_put() operations for these are atomic. (I betcha heappop() is too when 
implemented in C, but not when implemented in Python.)

I can't say I understand all of Antoine's patch, but it's probably okay to do 
it this way; however I would rather see if we can add _is_owned() to Lock, 
assuming it can be implemented using any of the threading/locking libraries we 
still support (I presume that's basically posix and Windows).

IIUC the end result would be a Queue whose put() works from signal handlers, GC 
callbacks and __del__, as long as it's unbounded, right? And when it *is* 
bounded, it will give a decent message if the queue is full and the lock is 
already taken, right? Antoine, can you confirm?

----------

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

Reply via email to