[Python-ideas] Multi-core reference count garbage collection

Jonathan Fine jfine2358 at gmail.com
Fri Jul 20 16:44:39 EDT 2018


Hi Steve

You wrote:
> My understanding is that reference counting is both deterministic and
> immediate. Shifting the reference counting into another thread so that
> it becomes non-deterministic and potentially delayed doesn't sound like
> an advantage to my naive understanding.

The choice is not as simple as that. Here's an example.

Suppose you and your friend want to sort a deck of cards. Here's an algorithm.

* Divide the deck into two
* Each person sorts their half deck
* One of you does a merge of the two half decks

This algorithm is non-deterministic. But for a large deck it's quicker
than any deterministic algorithm.

I hope this helps.

-- 
Jonathan


More information about the Python-ideas mailing list