[pypy-dev] GIL in non-Python languages

Maciej Fijalkowski fijall at gmail.com
Mon Mar 7 18:39:43 CET 2011

On Mon, Mar 7, 2011 at 9:08 AM, Timothy Baldridge <tbaldridge at gmail.com> wrote:
> Right, that would be an issue. In this case, I could probably start
> with a reference counting GC....as I'm not exactly sure that it's
> possible to get cyclic references with immutable objects. At least not
> without allot of work...yeah, I'm pretty sure they are impossible to
> code in Clojure. But someone may correct me there.


Refcounting GC would be generated for you, have you chosen to use it,
but it'll be very inefficient and probably not thread safe.

What you can do *right now* is to use boehm GC which is thread safe,
but not very fast (much faster and much better than refcounting
though). I don't think there are any other issues that are not thread
safe in RPython than GC. Obviously it's like C - if you do something
wrong you'll segfault.

However, the true answer would be to work on a real GC that
thread-friendly and thread-safe. This is work, it's however fun :-)

> Anyway, reference counting would get rid of most of the parallel
> issues with the GC, I could simply use a CAS or atomic instructions to
> increment/decrement reference counts.
> Timothy
>> One major problem is that RPython its self is not really thread-safe.
>> For example, the gc is very non-concurrent. So, that would have to be
>> fixed.
>> --
>> Regards,
>> Benjamin
> --
> “One of the main causes of the fall of the Roman Empire was
> that–lacking zero–they had no way to indicate successful termination
> of their C programs.”
> (Robert Firth)
> _______________________________________________
> pypy-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-dev

More information about the Pypy-dev mailing list