Skip to main content

Multiprocessing utils (shared locks and thread locals)

Project description

Multiprocessing utilities

Shared locks

“Shared” version of the standard Lock() and RLock() classes found in the multiprocessing/threading modules.

Shared locks can be acquired in two modes, shared and exclusive.

Any number of processes/threads can acquire the lock in shared mode.

Only one process/thread can acquire the lock in exclusive mode.

A process/thread attempting to exclusively acquire the lock will block until the lock has been released by all other threads/processes.

A process/thread attempting to shared acquire the lock will only block if there is an exclusive lock.

This is a little like database locks, which can be acquired for shared reading, or exclusive writing.

multiprocess theading.local()

A process and thread safe version of threading.local()

A standard threading.local() instance created before forking (via os.fork() or multiprocessing.Process()) will not behave as expected.

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

multiprocessing_utils-0.3.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

multiprocessing_utils-0.3-py2.py3-none-any.whl (9.9 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