|
|
|
|
|
by haberman
5999 days ago
|
|
> The problem with removing the GIL seems to be garbage collection. I'm not sure this is the real problem; after all, reference counts can be atomically incremented and decremented. The real problem is that primitive operations in Python (like "foo.bar") cannot safely be performed in C without locking, because you need the hash table to remain consistent while you are doing lookups and/or insertions. This forces you to either wrap all such operations in locks (which has been tried, and slows down the single-threaded case by something like 2x) or reimplement them with lock-free data structures. The latter could be an interesting experiment; you could probably implement a tree-based map using RCU. |
|