News for hackers. Stuff that matters.
Re:Presentation on the new Python GIL by haberman on Sunday January 17, 2010 @07:44PM (#1059198)
> 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.

There are no comments on this comment yet.