Feature request (was "parallel cell executing and wxmaxima")
Subject: Feature request (was "parallel cell executing and wxmaxima")
From: Richard Fateman
Date: Sun, 10 Jun 2012 17:14:06 -0700
On 6/10/2012 2:37 PM, Oliver Kullmann wrote:
>>> Of course (a) your lisp may not have mapcar-parallel, or anything even
>>> remotely like that,
>>> but just calls to some operating system function, or not even that...
>>> and (b) this solves none of the important problems involving shared state,
>> ... which is what the message that you replied to (and included below in
>> its entirety) said. Thanks.
>>
>> The point is that f, g and h can't (currently) be written in Maxima's
>> language and do anything non-trivial, because anything non-trivial in
>> Maxima touches serious amounts of shared state.
Need we be quite so pessimistic?
Let us assume for argument's sake that the model of multiprocessing
supported by your
Lisp allows one to start with an existing run-time stack and make some
number of copies,
one for each thread, and then lets them all loose, perhaps on different
processors or by
giving them time-slices. Ignoring the possibility that changing global
variables in one thread
would matter to another thread, or that some threads would not terminate
or ...., then there
is an issue of garbage collection of memory assuming it is a shared
memory, but multiple
stacks, different processors.
A simple solution for GC is perhaps stopping all useful work and
using one or more of the processors to do the GC. (There's a huge
literature on parallel GC,
and I haven't kept up with it. )
In any case, I think that if the Lisp supports an appropriate model of
threads, it
would not be out of the question for f, g, h,... to compute, say, parts
of a determinant,
e.g. bottom up computing 2X2 then 3X3 , etc. with f,g,h, ... being
Maxima programs.
You would have to be careful that the threads are independent.
It would be nice to have a hashtable model in which different processes
could insert
entries without worry. Maybe that's around too.
> Interesting, but a pity that there is no easy way. It would allow to
> express many algorithms in a more natural way (and more natural (and fun)
> to experiment with them).
>
> Oliver
>