Exlusive/Shared locking mechanism

Heiko Wundram hewu5001 at stud.uni-saarland.de
Wed Feb 12 07:59:39 EST 2003


Hello group!

I've devised a little script that does shared/exclusive locking not with
files (what I've so far seen very often), but using pure Python and the
threading module only.

It seems to work(tm).

Why I'm posting is the simple fact that nobody else seems to have come
up with such an implementation (it's not in the Python STL, and neither
on Parnassus or anywhere), and I didn't think implementing it was so
trivial... So, please tell me whether I've messed up greatly, or if this
module does the job, anyone who has more experience with threads than I
have... My logic tells me it should work similarily to file locking...

You are free to use this module in your code, btw., if you retain the
copyright. It's part of SharkyPy.

Yours,

	Heiko Wundram
	Sprachenzentrum der Universität des Saarlandes
	Gebäude 44 - Universität - 66123 Saarbrücken

-- 
,gis siht no noitpyrcne eht gnikaerb yB
.liaj ot oG .ACMD eht detaloiv evah uoy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Lock.py
Type: application/x-python
Size: 4211 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030212/dc2ffcfd/attachment.bin>


More information about the Python-list mailing list