Skip to main content

Parallel processing tools

Project description

Intro

The SELock is a shared/exclusive lock that you can use to safely read and write shared resources in a multi-threaded application.

Example:

use SELock to coordinate access to a shared resource

>>> from scottbrian_locking import se_lock as sel
>>> a_lock = sel.SELock()
>>> # Get lock in exclusive mode
>>> with sel.SELockExcl(a_lock):
...     msg = 'lock obtained exclusive'
>>> print(msg)
lock obtained exclusive
>>> # Get lock in shared mode
>>> with sel.SELockShare(a_lock):
...     msg = 'lock obtained shared'
>>> print(msg)
lock obtained shared
Security Status Documentation Status

Installation

Linux:

pip install scottbrian-locking

Development setup

See tox.ini

Release History

  • 1.0.0
    • Initial release

Meta

Scott Tuttle

Distributed under the MIT license. See LICENSE for more information.

Contributing

  1. Fork it (<https://github.com/yourname/yourproject/fork>)

  2. Create your feature branch (git checkout -b feature/fooBar)

  3. Commit your changes (git commit -am ‘Add some fooBar’)

  4. Push to the branch (git push origin feature/fooBar)

  5. Create a new Pull Request

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

scottbrian_locking-1.0.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

scottbrian_locking-1.0.0-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file scottbrian_locking-1.0.0.tar.gz.

File metadata

  • Download URL: scottbrian_locking-1.0.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for scottbrian_locking-1.0.0.tar.gz
Algorithm Hash digest
SHA256 05b2fbd416ab886811cd5fdfff4c9eea57fec03be8ff9ad7d27f29d61ae561bd
MD5 7528d7c337b8c0151e3de38eda562c0a
BLAKE2b-256 23a50cc83f7f07ffcbd30534aa7047eae107d069dbbf3a47eef16e72fc8f95df

See more details on using hashes here.

File details

Details for the file scottbrian_locking-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: scottbrian_locking-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for scottbrian_locking-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 faa3225e343fe1c99938a76ee3a70e7d2576a4e4a5db615a0132cca2bb2fff80
MD5 5c5726881071034b10280950465d01ca
BLAKE2b-256 09cbb1dd37eccf08e7e15f67074f20c69f3a300bb08860b229ba8835bed9ff29

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