Viewing File: /opt/alt/python311/lib64/python3.11/multiprocessing/__pycache__/shared_memory.cpython-311.pyc
fH d Z ddgZddlmZ ddlZddlZddlZddlZddlZddl Z ej
dk rddlZdZnddl
Z
dZd d
lmZ ej ej z ZdZerdZnd
Zd Z G d d ZdZ G d d ZdS )zProvides shared memory for direct access across processes.
The API of this package is currently provisional. Refer to the
documentation for details.
SharedMemory
ShareableList )partialNntFT )resource_tracker z/psm_wnsm_c t t t z
dz } | dk s
J d t t j | z }t | t k sJ |S )z6Create a random filename for the shared memory object. z_SHM_NAME_PREFIX too long)_SHM_SAFE_NAME_LENGTHlen_SHM_NAME_PREFIXsecrets token_hex)nbytesnames D/opt/alt/python311/lib64/python3.11/multiprocessing/shared_memory.py_make_filenamer ( sb $c*:&;&;;
AFQ;;;3;;;g/777Dt99-----K c e Zd ZdZdZdZdZdZej Z
dZerdndZ
ddZd Zd
Zd Zed Zed
Zed Zd Zd ZdS )r a Creates a new shared memory block or attaches to an existing
shared memory block.
Every shared memory block is assigned a unique name. This enables
one process to create a shared memory block with a particular name
so that a different process can attach to that same shared memory
block using that same name.
As a resource for sharing data across processes, shared memory blocks
may outlive the original process that created them. When one process
no longer needs access to a shared memory block that might still be
needed by other processes, the close() method should be called.
When a shared memory block is no longer needed by any process, the
unlink() method should be called to ensure proper cleanup.Ni TFr c x |dk st d |r.t t j z | _ |dk rt d |#| j t j z st d t r*|O t } t j || j | j
| _ n# t $ r Y Cw xY w|| _
n;| j rd|z n|}t j || j | j
| _ || _
|r|rt j | j | t j | j }|j }t% j | j | | _ n## t( $ r | w xY wt- j | j
d n|r# |t n|}t1 j t0 j t0 j t0 j |d z d
z |d
z | } t1 j }|t0 j k rZ|Bt t>