Re: Race condition on loading packages from 2 maxima processes in parallel?

Robert Dodier <[email protected]> Mon, 15 Jun 2026 10:43:09 -0700
Newsgroups gmane.comp.mathematics.maxima.general
Message-ID <CAAsY_sTOD-1BFbr0kqS7TXMgTuHh5kxybbVkgQvA2hvMoa14ew@mail.gmail.com>
On Sun, Jun 14, 2026 at 5:10 AM Gunter Königsmann via Maxima-discuss
<[email protected]> wrote:

> wxMaxima on every commit creates a new virtual machine, compiles wxMaxima in that machine and runs a few hundred tests in that machine.
>
> If it runs more than one test in parallel sometimes maxima fails to load draw.
>
> My theory is:
>
> One maxima process tries to load draw, compiles that package and starts saving it.
> A second maxima process tries to load the compiled draw package while that compiled package still being written.

Another potential source of problems is that Maxima wants to launch
Gnuplot as a long-running process and talk to it through a pipe. I'm
not sure what's going to happen if two instances of Maxima want to do
some plotting -- does each instance of Maxima get a separate instance
of Gnuplot, or do they inadvertently try to use the same one? (Both
the draw package and built-in plotting make use of the Gnuplot pipe
stuff.)

A work around is to tell Maxima to execute a one-off Gnuplot process
for each plot -- then the plotting commands are written to a temporary
file which is named according to the process ID of Maxima. I suppose
that would help so long as Maxima itself isn't calling plot functions
in different threads.

I don't know for sure the pipes stuff could cause trouble, but I
suppose it is easy to test -- just launch Maxima a few times and try
some plotting and count how many instance of Gnuplot are running.

Incidentally I've run into problems working with both draw and plot2d
in one Maxima process, because the configuration state leaks from one
into the other -- that's a separate issue, although it's also fixed by
forgoing the pipe stuff.

FWIW & all the best,

Robert


_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss