Skip to main content

Fast hierarchical locks

Project description

Hierarchical locks

Allows the caller to lock a "directory", or an individual file.

Locks are, by default, shared, recursive & timed.

First optional argument to the lock manager is the "sep".

Second optional argument is "flags" (default is HiLokFlags.RECURSIVE, can be also be HiLokFlags:STRICT).

from hilok import HiLok, HiLokError, HiLokFlags

h = HiLok()     # default sep is '/', can pass it in here

rd = h.read("/some/path")

# nonblocking, this will fail!
try:
    wr = h.write("/some", block=False)
except HiLokError:
    pass

rd.release()

wr = h.write("/some")

# timeout=0 is the the same as block=False
rd = h.read("/some/path", block=False)

# with syntax is fine:
with h.read("/some/path"):
    pass

Lock modes:

  • HiLokFlags.STRICT : not reentrant, the good mode
  • HiLokFlags.RECURSIVE : fully reentrant, supports escalation (read/write/release-read) and de-escalation (write/read/release-write)
  • HiLokFlags.RECURSIVE_WRITE : only write-locks are reentrant
  • HiLokFlags.RECURSIVE_ONEWAY : can read-lock while holding a write, but not vice-versa

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

hilok-1.3.1-cp311-cp311-win_amd64.whl (96.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

hilok-1.3.1-cp311-cp311-macosx_12_0_universal2.whl (80.2 kB view details)

Uploaded CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64)

hilok-1.3.1-cp310-cp310-win_amd64.whl (96.0 kB view details)

Uploaded CPython 3.10 Windows x86-64

hilok-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (102.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

hilok-1.3.1-cp310-cp310-macosx_12_0_x86_64.whl (80.3 kB view details)

Uploaded CPython 3.10 macOS 12.0+ x86-64

hilok-1.3.1-cp39-cp39-win_amd64.whl (96.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

hilok-1.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (102.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

hilok-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl (83.3 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

File details

Details for the file hilok-1.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: hilok-1.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 96.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for hilok-1.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 23f05706345c97f196ff9d6e602d092d11f9150e8a81be5c70c6a3d52d1501fa
MD5 ba3231fbe6aa0975bfa54939b4f48611
BLAKE2b-256 0203cb7a9182257e2aade9380e899f2a7c03bbbd4a18240b3b3034550d40e703

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp311-cp311-macosx_12_0_universal2.whl.

File metadata

File hashes

Hashes for hilok-1.3.1-cp311-cp311-macosx_12_0_universal2.whl
Algorithm Hash digest
SHA256 fae94f06b7553e1faa530a6a28bc4d9ad838fcfbecf6cd16d6c64c1e35106a86
MD5 055751a4027d8f0517fc720b6e178744
BLAKE2b-256 54f79d1ef2610f86fa996015de3592612caeafc1e14bda0cfb443eaf628a5e1c

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: hilok-1.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 96.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for hilok-1.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77afd64c1bae2e783f9eaadaa0b36fdfe7a082f81013b3cb18428df5325146c0
MD5 d471c0e748890fe4690db26c3f380159
BLAKE2b-256 a01aa26494519d0b60ab564efb43d82bc096271fd19a732d3b0205b1255ca04a

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hilok-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d6ebe785f0e706103088f06ac6ddcf81708c7cb048782de48e4c2ffac739fc2
MD5 f0359a34a315e46d23669cb759d60694
BLAKE2b-256 3f0bb4c6870cdc4f4b8cd00fa5b9636ceacdc8d495aacafd9dd873f592d5284f

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp310-cp310-macosx_12_0_x86_64.whl.

File metadata

File hashes

Hashes for hilok-1.3.1-cp310-cp310-macosx_12_0_x86_64.whl
Algorithm Hash digest
SHA256 8d292227b42ee4efa9b63b772d458266b1faa23e81786997d229e92e19d633f9
MD5 23a3d7929ebccf141b1e8e90deeccd12
BLAKE2b-256 22169f7f9edba5e412b9e4466f0c9f96ba30d68e82b05416355343eda4e74063

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: hilok-1.3.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 96.1 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for hilok-1.3.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ffaa8607a9a9fe06f0f88eed3e81cb0aa06479e466140a91b00a08da483650aa
MD5 a56126da3b040203efb5debfd67d8a0f
BLAKE2b-256 08fd945c2c22c28412137372904b462d2fb4ea4146781d62b9da81bf9ef990bd

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hilok-1.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40f8eec9b6e2b5791c8fd2a20a51f925cdacc419535471a53f0e9f830a35e5c7
MD5 c48cba0584d40222d79be7835f52b784
BLAKE2b-256 940ca45a3c1466bd0934d5e008bd58d584d37c8a91790bb88533e6101ef2d51a

See more details on using hashes here.

File details

Details for the file hilok-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for hilok-1.3.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 988da12b687f762b56d231c19875639c8e7e2b438e43a2d73c7055e341f6f1c7
MD5 3fd8e3386825506b05974f77891d729f
BLAKE2b-256 c9e0ca8c52ac132044b9bc05ea38abcc29026d2c9bb097f88e1992d6c6fc155c

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