Thread/Process-safety of functions in the Standard Library, eg the dbm classes

Aahz aahz at pythoncraft.com
Tue Apr 9 18:27:53 EDT 2002


In article <3cb32a63.17540718 at news.t-online.de>,
Gerson Kurz <gerson.kurz at t-online.de> wrote:
>
>I wonder if it is documented which functions of the Python Standard
>Library are threadsafe, and which not. More explicitly, I was having a
>look at the anydbm interface and am pretty sure that it is not safe to
>access from multiple-processes at the same time, and I don't even know
>whether or not it is safe for multiple threads.
>
>So, is there such a documentation? 

Use an extra thread to handle I/O for each dbm you open, then use Queue
to handle the inter-thread communication.  See my web page for some
examples.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"There are times when effort is important and necessary, but this should
not be taken as any kind of moral imperative."  --jdecker



More information about the Python-list mailing list