[Python-Dev] Re: [Web-SIG] Threading and client-side support

Aahz aahz at pythoncraft.com
Tue Oct 28 13:10:10 EST 2003


On Tue, Oct 28, 2003, John J Lee wrote:
> On Tue, 28 Oct 2003 amk at amk.ca wrote:
>> On Tue, Oct 28, 2003 at 10:35:33AM +0000, John J Lee wrote:
>>>
>>> Thanks.  So, in particular, httplib, urllib and urllib2 are thread-safe?
>>
>> No idea; reading the code would be needed to figure that out.
> 
> That might not be helpful if the person reading it (me) has zero
> threading experience ;-)
>
> I certainly plan to gain that experience, but surely *somebody*
> already knows whether they're thread-safe?  I presume they are,
> broadly, since a couple of violations of thread safety are commented
> in urllib2 and urllib.  Right?

Generally speaking, any code that does not rely on global objects is
thread-safe in Python.  For more information, let's take this to
python-list.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan



More information about the Web-SIG mailing list