Your IP : 3.15.229.217


Current Path : /opt/alt/python310/lib64/python3.10/multiprocessing/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/multiprocessing/__pycache__/context.cpython-310.opt-2.pyc

o

6��fM-�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdkr�Gdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"kr�eed#�Zn#eed$�ZnGd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@�eZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�>/opt/alt/python310/lib64/python3.10/multiprocessing/context.pyr�rc@r)�BufferTooShortNrrrrrrr
rc@r)�TimeoutErrorNrrrrrrr
rc@r)�AuthenticationErrorNrrrrrrr
rc@s\eZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdEdd�Zdd�ZdFdd�ZdGdd�ZdGdd�Zdd�Z		dHd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdDd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dDd7d8�Z$dId:d;�Z%dId<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)J�BaseContextcCs	t��}|dur
td��|S)Nzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�selfZnumrrrr)s
zBaseContext.cpu_countcCs(	ddlm}||��d�}|��|S)Nr)�SyncManager��ctx)Zmanagersr�get_context�start)rr�mrrr�Manager1s
zBaseContext.ManagerTcC�	ddlm}||�S)Nr)�Pipe)�
connectionr)rZduplexrrrrr<�zBaseContext.PipecC�	ddlm}||��d�S)Nr)�Lockr)�synchronizer"r)rr"rrrr"A�zBaseContext.LockcCr!)Nr)�RLockr)r#r%r)rr%rrrr%Fr$zBaseContext.RLockNcC�	ddlm}|||��d�S)Nr)�	Conditionr)r#r'r)r�lockr'rrrr'K�zBaseContext.ConditionrcCr&)Nr)�	Semaphorer)r#r*r)r�valuer*rrrr*Pr)zBaseContext.SemaphorecCr&)Nr)�BoundedSemaphorer)r#r,r)rr+r,rrrr,Ur)zBaseContext.BoundedSemaphorecCr!)Nr)�Eventr)r#r-r)rr-rrrr-Zr$zBaseContext.EventcC�"	ddlm}|||||��d�S)Nr)�Barrierr)r#r/r)rZparties�actionZtimeoutr/rrrr/_szBaseContext.BarrierrcCr&)Nr)�Queuer)�queuesr1r)r�maxsizer1rrrr1dr)zBaseContext.QueuecCr&)Nr)�
JoinableQueuer)r2r4r)rr3r4rrrr4ir)zBaseContext.JoinableQueuecCr!)Nr)�SimpleQueuer)r2r5r)rr5rrrr5nr$zBaseContext.SimpleQueuercCs$	ddlm}||||||��d�S)Nr)�Pool)�context)Zpoolr6r)rZ	processesZinitializerZinitargsZmaxtasksperchildr6rrrr6ss

�zBaseContext.PoolcGs	ddlm}||g|�R�S)Nr)�RawValue)�sharedctypesr8)r�typecode_or_type�argsr8rrrr8zr)zBaseContext.RawValuecCs	ddlm}|||�S)Nr)�RawArray)r9r<)rr:�size_or_initializerr<rrrr<s
zBaseContext.RawArray)r(cGs*	ddlm}||g|�R||��d��S)Nr)�Value�r(r)r9r>r)rr:r(r;r>rrrr>�s
�zBaseContext.ValuecCr.)Nr)�Arrayr?)r9r@r)rr:r=r(r@rrrr@�s
�zBaseContext.ArraycCs6	tjdkrttdd�rddlm}|�dSdSdS)N�win32�frozenFr)�freeze_support)�sys�platform�getattr�spawnrC)rrCrrrrC�s

�zBaseContext.freeze_supportcCs	ddlm}|�S)Nr)�
get_logger)�utilrH)rrHrrrrH�szBaseContext.get_loggercCr)Nr)�
log_to_stderr)rIrJ)r�levelrJrrrrJ�r zBaseContext.log_to_stderrcCs	ddlm}dS)Nr)r)�r)rrrrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcC�	ddlm}||�dS)Nr)�set_executable)rGrO)r�
executablerOrrrrO�szBaseContext.set_executablecCrN)Nr)�set_forkserver_preload)�
forkserverrQ)rZmodule_namesrQrrrrQ�sz"BaseContext.set_forkserver_preloadcCsB|dur|Szt|}Wntytd|�d�w|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�s�zBaseContext.get_contextFcCs|jS�N)�_name�rZ
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��)Nz+cannot set start method of concrete context)rU�rrWZforcerrr�set_start_method�szBaseContext.set_start_methodcCs	t��d�S�Nr)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dSr^)r_)rrrrrrb��cC�dSrXrrarrrrV�szBaseContext._check_available)TrX)r)NN)r)NNrN�F)+r	r
rrrrr�staticmethodrZcurrent_processZparent_processZactive_childrenrrrr"r%r'r*r,r-r/r1r4r5r6r8r<r>r@rCrHrJrMrOrQrr[r]�propertyrb�setterrVrrrrrsT










�






rc@s(eZdZdZedd��Zedd��ZdS)�ProcessNcCst��j�|�SrX)�_default_contextrri�_Popen)�process_objrrrrk�szProcess._PopencCst��j��SrX)rjrri�_after_forkrrrrrm�rczProcess._after_fork�r	r
r�
_start_methodrfrkrmrrrrri�s
ricsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrX)rj�_actual_context)rr7rrr�__init__�s
zDefaultContext.__init__Ncs,|dur|jdur
|j|_|jSt��|�SrX)rqrj�superr)rrW��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdur|std��|dur|rd|_dS|�|�|_dS)Nzcontext has already been set)rq�RuntimeErrorrr\rrrr]�szDefaultContext.set_start_methodcCs"|jdur
|r	dS|j|_|jjSrX)rqrjrYrZrrrr[�s

zDefaultContext.get_start_methodcCs>tjdkrdgStjdkrddgnddg}tjr|�d�|S)NrArG�darwin�forkrR)rDrEr�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methodsrXre)
r	r
rrirrrr]r[r|�
__classcell__rrrtrrp�s

rprAc@�eZdZdZedd��ZdS)�ForkProcessrxcC�ddlm}||�S�Nr)�Popen)Z
popen_forkr��rlr�rrrrk�zForkProcess._PopenN�r	r
rrorfrkrrrrr�rc@�(eZdZdZedd��Zedd��ZdS)�SpawnProcessrGcCr�r�)Zpopen_spawn_posixr�r�rrrrkr��SpawnProcess._PopencCrdrXrrrrrrm"��SpawnProcess._after_forkNrnrrrrr��
r�c@r~)�ForkServerProcessrRcCr�r�)Zpopen_forkserverr�r�rrrrk)r�zForkServerProcess._PopenNr�rrrrr�'r�r�c@�eZdZdZeZdS)�ForkContextrxN)r	r
rrYrrirrrrr�.�r�c@r���SpawnContextrGN�r	r
rrYr�rirrrrr�2r�r�c@seZdZdZeZdd�ZdS)�ForkServerContextrRcCstjstd��dS)Nz%forkserver start method not available)rryrUrarrrrV9s�z"ForkServerContext._check_availableN)r	r
rrYr�rirVrrrrr�6sr�)rxrGrRrwrGrxc@r�)r�rGcCr�r�)Zpopen_spawn_win32r�r�rrrrkMr�r�cCrdrXrrrrrrmRr�r�Nrnrrrrr�Kr�c@r�r�r�rrrrr�Wr�cCst|t_dSrX)rSrjrq)rWrrr�_force_start_methoddsr�cCsttdd�S)N�spawning_popen)rF�_tlsrrrr�get_spawning_popenmsr�cCs
|t_dSrX)r�r�)�popenrrr�set_spawning_popenps
r�cCs t�durtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r�rv�typer	)�objrrr�assert_spawningss
���r�) rrDZ	threadingrLrr�__all__�	Exceptionrrrr�objectrZBaseProcessrirprErr�r�r�r�r�rSrjr�Zlocalr�r�r�r�rrrr�<module>sL?

,�
�

?>