Python module for an atomic named interprocess lock which is local to the machine.
Project description
Python module for an atomic named interprocess lock which is local to the machine.
This means that this lock works across process boundries, so you can use it to lock objects that multiple processes would use.
NamedAtomicLock works by taking advantage of the fact that POSIX defines mkdir to be an atomic operation. So a directory is used as the name.
All UNIX systems are supported, overhead is light, and the lock is global to the system.
The NamedAtomicLock module provides a class NamedAtomicLock which implements the “lock” interface, with familiar “acquire” and “release” methods.
Documentation
Example
A basic usage example
from NamedAtomicLock import NamedAtomicLock
myLock = NamedAtomicLock(‘myLock’)
if myLock.acquire(timeout=15):
doWork()
myLock.release()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file NamedAtomicLock-1.1.2.tar.gz
.
File metadata
- Download URL: NamedAtomicLock-1.1.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0846384808df4910feeb7fff6479468f6028443d4bb0b1ae0ec884faa01e904d |
|
MD5 | 55063f69a2a5479e02035b4c95c4e740 |
|
BLAKE2b-256 | 5cd9229552511a177d9b626d2e6f7910826f0a01476e2ce9662496b1ed04f034 |