Adding a Par construct to Python?

jeremy at martinfamily.freeserve.co.uk jeremy at martinfamily.freeserve.co.uk
Mon May 18 22:56:38 CEST 2009


On 18 May, 21:07, Terry Reedy <tjre... at udel.edu> wrote:
> George Sakkis wrote:
> > On May 18, 5:27 am, jer... at martinfamily.freeserve.co.uk wrote:
>
> >> My suggestion is primarily about using multiple threads and sharing
> >> memory - something akin to the OpenMP directives that one of you has
> >> mentioned. To do this efficiently would involve removing the Global
> >> Interpreter Lock, or switching to Jython or Iron Python as you
> >> mentioned.
>
> >> However I *do* actually want to add syntax to the language.
>
> I can understand you having a preference, but you may have to choose
> between fighting over that method or achieving results.  I agree with ...
>
> > Good luck with that. The GIL is not going away any time soon (or
> > probably ever) and as long as CPython is the "official"
> > implementation, there are almost zero chances of adding syntax support
> > for this. Besides, Guido and other py-devs are not particularly keen
> > on threads as a parallelization mechanism.
>
> Parallel processes can run on multiple processors as well as multiple
> cores within a processor.  Some problems, like massive search, require
> multiple disks (or memories, or IO ports) as well as multiple processing
> units.  There is debate over how useful massively multicore processors
> will actually be and for which types of problems.
>
> tjr

Hi Terry,

> Parallel processes can run on multiple processors as well as multiple
> cores within a processor.  Some problems, like massive search, require
> multiple disks (or memories, or IO ports) as well as multiple processing
> units.  There is debate over how useful massively multicore processors
> will actually be and for which types of problems.

I agree with this. My approach is in the same space as OpenMP - a
simple way for users to define shared memory parallelism. There is no
reason why it would not work with multiple disks or IO ports on the
same shared memory server. However for distributed memory hardware it
would be a non-starter. In that case we would need something like the
Message Passing Interface.

Jeremy



More information about the Python-list mailing list