[pypy-dev] PyPy STM

Bengt Richter bokr at oz.net
Tue Oct 2 13:40:09 CEST 2012


On 09/30/2012 04:22 PM Armin Rigo wrote:
> Hi Ronny,
>
> On Sun, Sep 30, 2012 at 3:50 PM, Ronny Pfannschmidt
> <Ronny.Pfannschmidt at gmx.de>  wrote:
>> after my thesis i'll be experimenting with a relaxed csp-ish model
>> based on python native generator based continuations as well as
>> the new continulet-jit-3 based greenlets.
>>
>> my basic assumption is that having limited amount
>> of shared memory is acceptable.
>
> What you are thinking about is to start from the naturally multicore
> model of separate address spaces, and add some amount of shared
> memory.  You would use STM to handle the result.  It is the opposite
> of what I'm thinking about, which is to start with a non-multithread,
> non-tasklet-based program and add multicore capability to it.  I would
> be using STM to "create" multicore capability, whereas you would be
> using it to "create" shared memory.  I am more interested in the first
> approach than the second because I think it is closer to what
> untrained programmers start with, but both approaches are potentially
> valid.
>
> Russel: STM is a powerful tool that makes sense of shared memory in
> multicore situations.  I fail to understand why you are looking at it
> in the absence of shared memory...
>
>
> A bientôt,
>
> Armin.

Hi Armin,

Just a triggered thought: I am wondering if Conway's Game of Life
     http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
might be be an interesting/fun basis for experiments and maybe a benchmark
for STM use in the parallel update of the life grid.

I am thinking of in-place update, since old-frame -> new-frame would
not create any conflicts.

A naive single-thread in-place update would obviously require
local neighbor "old-frame" values to calculate correct updates,
so a programmer would naturally have to provide for that somehow.

What kinds of design patterns wrt STM would emerge from solving the problem in various
loops that create different interferences when parallelized, e.g., looping by rows
vs looping recursively through tiles and subtiles, vs maybe using a quadtree representation
or whatever?

I am wondering how you would visualize STM helping in bringing either manual or
automated parallelism into this update problem, say with a goal of maximizing
frame rate.

And what do you expect the "untrained programmers" to think of, and to be able to avoid
thinking about, because of STM, in their designs.

Regards,
Bengt Richter




More information about the pypy-dev mailing list