Author: Laura Creighton <l...@openend.se> Branch: extradoc Changeset: r3808:07f81f00b8d8 Date: 2011-06-29 18:04 +0200 http://bitbucket.org/pypy/extradoc/changeset/07f81f00b8d8/
Log: add something about funding, minor tweak diff --git a/blog/draft/gil.rst b/blog/draft/gil.rst --- a/blog/draft/gil.rst +++ b/blog/draft/gil.rst @@ -11,7 +11,7 @@ all the mutable built-in types, and by relying on the underlying Java platform to be efficient about them (so that the result is faster than, say, very carefully adding similar locks in CPython). By "very -carefully", I mean really really carefully; for example, +carefully", I mean *really* *really* carefully; for example, 'dict1.update(dict2)' needs to lock both dict1 and dict2, but if you do it naively, then a parallel 'dict2.update(dict1)' might cause a deadlock. @@ -72,7 +72,7 @@ thread-local ``transaction`` object. We store in it which objects we read from, which objects we write to, and what values we write. It is only when the transaction reaches its end that we attempt to "commit" -it. Committing might fail if other commits have occurred inbetween, +it. Committing might fail if other commits have occurred in between, creating inconsistencies; in that case, the transaction aborts and must restart from the beginning. @@ -83,8 +83,12 @@ This is very similar to what is going on in CPython with the GIL. In particular, it means that it gives programmers all the same guarantees as the GIL does. The *only* difference is that it can actually run -multiple threads in parallel, as long as their code are not interfering -with each other. +multiple threads in parallel, as long as their code does not interfere +with each other. + +XXX how much slower would it make things for the person whose code +isn't suitable to try to run it? All of us? Is this an option you +could enable? Why not apply that idea to CPython? Because we would need to change everything everywhere. In the example above, you may have noted that I @@ -93,10 +97,10 @@ to do their work "transactionally". This means that instead of really changing the global memory in which the list is stored, it must instead record the change in the ``transation`` object. If our interpreter is -written in C, like CPython, then we need to write it explicitly -everywhere. If it is written instead in a higher-level language, like -PyPy, then we can add this behavior as translation rules, and apply it -automatically wherever it is necessary. +written in C, as CPython is, then we need to write it explicitly +everywhere. If it is written instead in a higher-level language, as +PyPy is, then we can add this behavior as as set of translation rules, and +apply them automatically wherever it is necessary. A final note: as STM research is very recent (it started around 2003), there are a number of variants around, and it's not clear yet which one @@ -105,9 +109,20 @@ Transactional Memory" seems to be one possible state-of-the-art; it also seems to be "good enough for all cases". -So, when will it be done? No clue so far. It is still at the idea stage, -but I *think* that it can work. <Insert here something about funding :-> +So, when will it be done? No clue so far. It is still at the idea +stage, but I *think* that it can work. How long would it take us to +write it? Again no clue, but we are looking at many months rather +than many days. This is the sort of thing that I (Armin Rigo) would +like to be able to work on full time after the `Eurostars funding`_ +runs out on September 1. We are currently looking at ways to use +`crowdfunding`_ to raise money so that I can do exactly that. Expect +a blog post about that very soon. But this looks like a perfect +candidate for crowdfunding -- there are at least thousands of you who +would be willing to pay 10s of Euros to Kill the Gil. Now we only +have to make this happen. .. _`Software Transactional Memory`: http://en.wikipedia.org/wiki/Software_transactional_memory .. _`this paper`: +.. _`Eurostars funding`: http://morepypy.blogspot.com/2010/12/oh-and-btw-pypy-gets-funding-through.html +.. _`crowdfunding`:http://en.wikipedia.org/wiki/Crowd_funding \ No newline at end of file _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit