Provide shared memory data structures!
Project description
Shared Memory Data Structure
This package allows you to use your data structures like numpy arrays in the shared memory environment between two or more python processes. This library simplifies the use of shared memory data structures as you don't need to manually manage shared memory.
E.g:
Process #1
from shared_ds import SharedArray
# Create shared memory and put you numpy array into that memory segment.
shared_np_array = SharedArray.from_array(np_array)
shm_descriptor = shared_np_array.to_json()
Process #2
from shared_ds import SharedArray
# Attaches to existing shared memory and reads numpy array representation.
shared_np_array = SharedArray.from_json(shm_descriptor)
shm_descriptor = shared_np_array.to_json()
Important !!!
Always delete your data structures after use.
from shared_ds import SharedArray
# Create shared memory and put you numpy array into that memory segment.
shared_np_array = SharedArray.from_array(np_array)
shm_descriptor = shared_np_array.to_json()
# Delete and release SHM after usage.
shared_np_array.destroy()
Currently supported data structures:
- Numpy Array
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
shared_ds-0.0.3.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for shared_ds-0.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e37e6b44c0d17fe72347dacd9980a545e40194d97b14347d8e0bb867e423351 |
|
MD5 | f096e62897ac8cda8787283cca9a7103 |
|
BLAKE2b-256 | 26a48f16619745d0860b53219c9fef0daee2defc455b62566453cf3ade19ecef |