Urllib thread safe?

Oleg Broytmann phd at phd.pp.ru
Thu Jun 6 08:22:03 EDT 2002


On Thu, Jun 06, 2002 at 10:31:52AM +0200, Martin v. LЖwis wrote:
> >    I am afraid you would have problems mixing calls to the global
> > _urlopener from different threads.
> 
> Can you be more specific as to how precisely such problems could
> arise?

   I said "I am afraid" - that is, I am not sure if this could lead to
probles. But I learned hard that global variables are enemies of
multithreaded programs. And in this particular case the global _urlopener
is an instance of class with long and complex methods. I would be very
worried to share the instance between threads.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list