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
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
Fork it (<https://github.com/yourname/yourproject/fork>)
Create your feature branch (git checkout -b feature/fooBar)
Commit your changes (git commit -am ‘Add some fooBar’)
Push to the branch (git push origin feature/fooBar)
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)
Built Distribution
Close
Hashes for scottbrian_locking-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faa3225e343fe1c99938a76ee3a70e7d2576a4e4a5db615a0132cca2bb2fff80 |
|
MD5 | 5c5726881071034b10280950465d01ca |
|
BLAKE2b-256 | 09cbb1dd37eccf08e7e15f67074f20c69f3a300bb08860b229ba8835bed9ff29 |