telnetlib thread-safe?

Diez B. Roggisch deets at nospam.web.de
Thu Aug 24 14:37:10 EDT 2006


Jerry schrieb:
> Fredrik Lundh wrote:
>> define thread-safe.  how do you plan to use it?
> 
> I would like to write a program that spawns ~10 threads.  Each thread
> would get a host to connect to from a Queue object and run then do it's
> thing (i.e. connecting to the host, running some commands, returning
> back a success or fail based on the results).
> 
> I just want to make sure that telnetlib is safe for this.

Usually, OO-style libs that don't share state between objects are pretty 
safe - and  I'd presume that this holds for telnetlib, too.

There is of course no way except looking into the source to _know_ that 
for sure. So - try it out.

Diez



More information about the Python-list mailing list