Skip to main content

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

See http://htmlpreview.github.io/?https://github.com/kata198/NamedAtomicLock/blob/master/doc/NamedAtomicLock.html

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

NamedAtomicLock-1.1.1.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file NamedAtomicLock-1.1.1.tar.gz.

File metadata

File hashes

Hashes for NamedAtomicLock-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d852cb03cd99023995cbb8054a60ea4e1c776a35d6e493806b373fbfc194919d
MD5 549a694ec73ee7c32e829d964f983671
BLAKE2b-256 2f44afe164aced7e7fc380523de195ed892d8ae887376381ec07ee3cb52925dd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page