python-multiprocessing-utils
Multiprocessing utilities
multiprocess-safe threading.local()
A process (and thread) safe version of threading.local()
l = multiprocessing_utils.local()
l.x = 1
def f():
try:
print(l.x)
except Attribute:
print("x not set")
f() # prints "1"
threading.Thread(target=f).start() # prints "x not set"
multiprocessing.Process(target=f).start() # prints "x not set"
Difference to standard threading.local()
A standard threading.local() instance created before forking (via os.fork() or multiprocessing.Process()) will be “local” as expected and the new process will have access to any data set before the fork.
Using a standard threading.local() in the example above would yield:
f() # prints "1" threading.Thread(target=f).start() # prints "x not set" multiprocessing.Process(target=f).start() # prints "1" :(
Metadata
Release files for multiprocessing-utils 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multiprocessing_utils-0.4.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| multiprocessing_utils-0.4-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / multiprocessing_utils-0.4.tar.gz
| Download URL | multiprocessing_utils-0.4.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43281d5e017d9b3f3e6114762c21f10c2a2b0392837c5096380e6c413ae79b6c
|
|
BLAKE2b-256 checksum How to use checksums |
7f23ee76f1f2d501411afc152208d30d1575a8e76929eca276b94f4e44600085
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / multiprocessing_utils-0.4-py2.py3-none-any.whl
| Download URL | multiprocessing_utils-0.4-py2.py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c232e0bbc6ba753ca7a0df5d49b0cc4e26454635d4f373f5133c551aec8c27ee
|
|
BLAKE2b-256 checksum How to use checksums |
705c2e3065be295ca10f39d22579fc59ba8dd258123b0d66209bb4ff7c3d4557
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |