Re: [Matplotlib-users] matplotlib threadsafe?

2008-04-09 Thread Chris Withers
Eric Firing wrote: Out of interest, how does one tell MPL to start a new figure and forget everything that's gone before? You can minimize the amount of package and module-level state information by using the oo interface: see examples/agg_oo.py. I tried this example, and it generates

Re: [Matplotlib-users] matplotlib threadsafe?

2008-04-09 Thread Eric Firing
Chris Withers wrote: Eric Firing wrote: Out of interest, how does one tell MPL to start a new figure and forget everything that's gone before? You can minimize the amount of package and module-level state information by using the oo interface: see examples/agg_oo.py. I tried this

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-21 Thread Eric Firing
Out of interest, how does one tell MPL to start a new figure and forget everything that's gone before? You can minimize the amount of package and module-level state information by using the oo interface: see examples/agg_oo.py. If you change any rcParams dictionary entries, typically using

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-21 Thread John Hunter
On Fri, Mar 21, 2008 at 1:40 AM, Eric Firing [EMAIL PROTECTED] wrote: Out of interest, how does one tell MPL to start a new figure and forget everything that's gone before? You can minimize the amount of package and module-level state information by using the oo interface: see

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-20 Thread Chris Withers
Michael Droettboom wrote: At least the Agg backend *looks* to be reasonably threadsafe -- there are no obvious gotchas like global variables etc. Note, though, that multithreading may not gain much in the way of performance since the global interpreter lock is never released around

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-20 Thread Chris Withers
Eric Firing wrote: In general, I don't think mpl is threadsafe at all; it uses global variables, such as all the rc parameters, that could easily be modified by one thread while being used by another. Yep, I guessed as much, BFL it is then ;-) I think that great care would be needed if

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-19 Thread Michael Droettboom
Eric Firing wrote: In general, I don't think mpl is threadsafe at all; it uses global variables, such as all the rc parameters, that could easily be modified by one thread while being used by another. I think that great care would be needed if one wanted to have multiple threads making

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-18 Thread Michael Droettboom
At least the Agg backend *looks* to be reasonably threadsafe -- there are no obvious gotchas like global variables etc. Note, though, that multithreading may not gain much in the way of performance since the global interpreter lock is never released around long-running C blocks. However, I

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-18 Thread Eric Firing
In general, I don't think mpl is threadsafe at all; it uses global variables, such as all the rc parameters, that could easily be modified by one thread while being used by another. I think that great care would be needed if one wanted to have multiple threads making plots. Having one