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. > >

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 ge

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: s

Re: [Matplotlib-users] matplotlib threadsafe?

2008-03-20 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 us

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

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 long

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 > maki

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 plotting

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 can

[Matplotlib-users] matplotlib threadsafe?

2008-03-17 Thread Chris Withers
Hi All, I'm wondering what work people have done with matplotlib in multi-threaded environments such as your average python web framework. Is matplotlib threadsafe? How have people gone about safely using it in a multi-threaded environment? cheers, Chris -- Simplistix - Content Management,