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

Gerson Kurz gerson.kurz at t-online.de
Tue Apr 9 14:01:02 EDT 2002


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? 

Furthermore, do you have any suggestions for these requirements: I
want to be able to store some data (<100K), and access it from
multiple processes in a safe way. Currently I'm using mySQL with
mysqldb, which seems like heavy overkill for that amount of data.
Plus, I want users to use my program without having to first install
MySQL (or any other dbm for that matter).

[A hardcore idea would be to make a "anydbm-server" that you can
communicate with using sockets ;]



More information about the Python-list mailing list