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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

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