Message395852
There are different ways to fix this issue:
* (A) Rewrite threading.enumerate() in C with code which cannot trigger a GC collection
* (B) Disable temporarily the GC
* (C) Use a reentrant lock (PR 26727)
(A) The problem is that functions other than threading.enumerate()
also rely on this lock, like threading.active_count(). I would prefer to not have to rewrite "half" of threading.py in C. Using a RLock is less intrusive.
(B) This is a simple and reliable option. But gc.disable() is process-wide: it affects all Python threads, and so it might have surprising side effects. Some code might rely on the current exact GC behavior. I would prefer to not disable the GC temporarily. |
|
Date |
User |
Action |
Args |
2021-06-14 21:53:33 | vstinner | set | recipients:
+ vstinner |
2021-06-14 21:53:33 | vstinner | set | messageid: <1623707613.91.0.281785888592.issue44422@roundup.psfhosted.org> |
2021-06-14 21:53:33 | vstinner | link | issue44422 messages |
2021-06-14 21:53:33 | vstinner | create | |
|