15 Sep 2009 06:28
server-less multi-process concurrency for durus
Matthew Scott <gldnspud <at> gmail.com>
2009-09-15 04:28:13 GMT
2009-09-15 04:28:13 GMT
David (and anyone else interested), I'd like you to nitpick this idea I have to add server-less, multi- process concurrency to Durus. Goal: Allow more than one process and/or thread on a single machine to reliably access and write to a Durus file, without having to maintain a separate process for a Durus server, and without having to install more Python packages. I'll present several actions that a process or thread might take, and how Durus would behave to support those actions. Please let me know if you think this will work, any details or quirks you can think of that might get in the way, etc. In return I will put some time into this to see if I can produce a working patch. == Lock file == Kept as a separate file, "mydatabase.durus.lock" being locked only during write operations. This is to allow all processes to at least read up to a "known good" EOF marker while another process is writing a transaction. == Packing == I haven't thought through this part as of yet, but I'm not worried about it at the moment. == Initial opening of a file == 1. seek(SEEK_END), tell(), keep as current EOF offset 2. read initial state from file, create in-memory state(Continue reading)
RSS Feed