Persistent Queue implementations?

Aahz aahz at pythoncraft.com
Tue Dec 24 16:24:18 EST 2002


In article <au833j$a7f$1 at baldur.whoi.edu>,
Karl A. Krueger <kkrueger at example.edu> wrote:
>
>Using pickle in the most obvious way (pickling the whole queue) would
>have to be done in every put() and get() call, since the copy on disk
>needs to reflect the copy in memory.  And pickling the whole queue would
>be -slow-, since it would have to write the whole queue each time --
>keeping it locked for read, and thus blocking all the threads that want
>to write to it.

Just how much ACID do you need, anyway?  If you really care, you should
use a full-blown database.  If not, I'd take Kevin's advice to use
cPickle, possibly using a separate thread to do the writes.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"I disrespectfully agree."  --SJM



More information about the Python-list mailing list