thread safe SMTP module

Aahz aahz at pythoncraft.com
Sat Mar 3 19:17:40 EST 2007


In article <mailman.4616.1172878783.32031.python-list at python.org>,
Gordon Messmer  <gmessmer at u.washington.edu> wrote:
>
>I believe that I've seen this discussed previously, so maybe there's
>some interest in it.  I wrote a threaded mail filtering framework
>a while ago, and one of the modules does address verification
>via SMTP.  Since smtplib.SMTP uses blocking IO, it can block the
>whole interpreter.  Sometimes the whole thing would stop working
>indefinitely.

That doesn't make any sense.  Blocking I/O generally releases the GIL,
which is the whole reason Python doesn't totally suck for threading.
There may be other thread problems, but I doubt that you have correctly
analyzed their source.  You can prove this for yourself by trying out my
threaded spider at
http://www.pythoncraft.com/OSCON2001/ThreadPoolSpider.py
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I disrespectfully agree."  --SJM



More information about the Python-list mailing list