Locking around

Tobiah toby at tobiah.org
Wed Aug 6 12:11:14 EDT 2008


On Mon, 04 Aug 2008 15:30:51 +0200, Nikolaus Rath wrote:

> Hello,
> 
> I need to synchronize the access to a couple of hundred-thousand
> files[1]. It seems to me that creating one lock object for each of the
> files is a waste of resources, but I cannot use a global lock for all
> of them either (since the locked operations go over the network, this
> would make the whole application essentially single-threaded even
> though most operations act on different files).

Do you think you could use an SQL database on the network to
handle the locking?  I was thinking of a table with one row
per file.  If the lock field is clear, you could update with a unique
ID, and query back to make sure that it is still yours before
accessing the file.

Hey, maybe the files themselves should go into blobs.


** Posted from http://www.teranews.com **



More information about the Python-list mailing list