[Python-ideas] Extending language syntax

Charles-François Natali cf.natali at gmail.com
Tue Nov 12 19:25:21 CET 2013


2013/11/12 Andrew Barnert <abarnert at yahoo.com>:
> The whole point of a "permanent" flag would be that it's only set at object creation time and never modified, and the object never gets cleaned up.

Of course. I probably wasn't clear, but I was actually referring to this part:

> Is there any implementation (like one of the PyPy sub projects) that uses refcounting, with interlocked increments if two interpreter threads are live but plain adds otherwise?

I'm not sure how one would do this without using locking/memory
barriers (hence a large performance overhead).


Regarding this question, as noted by Nick, you might want to have a
look at pyparallel: apparently, it uses a form of region-based memory
allocation, per-thread (using mprotect to catch references to
main-thread owned objects). But last time I checked with Trent,
reference counting/garbage collection was completely disabled in
worker theads, which means that if you allocate and free many objects,
you'll run out of memory (having an infinite amount of memory
certainly makes garbage collection easier :-) ).

Cheers,

cf


More information about the Python-ideas mailing list