Mini Shell

Direktori : /lib64/python3.9/multiprocessing/__pycache__/
Upload File :
Current File : //lib64/python3.9/multiprocessing/__pycache__/context.cpython-39.pyc

a

�DOg�+�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdk�rRGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"k�rDeed#�Zneed$�Zn8Gd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@seZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�//usr/lib64/python3.9/multiprocessing/context.pyrsrc@seZdZdS)�BufferTooShortNrrrrrrsrc@seZdZdS)�TimeoutErrorNrrrrrr
sr
c@seZdZdS)�AuthenticationErrorNrrrrrrsrc@sXeZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dLd7d8�Z$dMd:d;�Z%dNd<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)O�BaseContextcCs"t��}|durtd��n|SdS)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�self�numrrrr)s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)�managersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcCsddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr)r�duplexrrrrr<szBaseContext.PipecCsddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr)�synchronizer r)rr rrrr AszBaseContext.LockcCsddlm}||��d�S)zReturns a recursive lock objectr)�RLockr)r!r"r)rr"rrrr"FszBaseContext.RLockNcCsddlm}|||��d�S)zReturns a condition objectr)�	Conditionr)r!r#r)r�lockr#rrrr#KszBaseContext.ConditionrcCsddlm}|||��d�S)zReturns a semaphore objectr)�	Semaphorer)r!r%r)r�valuer%rrrr%PszBaseContext.SemaphorecCsddlm}|||��d�S)z"Returns a bounded semaphore objectr)�BoundedSemaphorer)r!r'r)rr&r'rrrr'UszBaseContext.BoundedSemaphorecCsddlm}||��d�S)zReturns an event objectr)�Eventr)r!r(r)rr(rrrr(ZszBaseContext.EventcCs ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)r!r)r)r�parties�action�timeoutr)rrrr)_szBaseContext.BarrierrcCsddlm}|||��d�S)�Returns a queue objectr)�Queuer)�queuesr.r)r�maxsizer.rrrr.dszBaseContext.QueuecCsddlm}|||��d�S)r-r)�
JoinableQueuer)r/r1r)rr0r1rrrr1iszBaseContext.JoinableQueuecCsddlm}||��d�S)r-r)�SimpleQueuer)r/r2r)rr2rrrr2nszBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)�poolr3r)r�	processes�initializer�initargs�maxtasksperchildr3rrrr3ss
�zBaseContext.PoolcGsddlm}||g|�R�S)zReturns a shared objectr)�RawValue)�sharedctypesr:)r�typecode_or_type�argsr:rrrr:zszBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)r;r>)rr<�size_or_initializerr>rrrr>szBaseContext.RawArray)r$cGs(ddlm}||g|�R||��d��S)z$Returns a synchronized shared objectr)�Value�r$r)r;r@r)rr<r$r=r@rrrr@�s�zBaseContext.ValuecCs ddlm}|||||��d�S)z#Returns a synchronized shared arrayr)�ArrayrA)r;rBr)rr<r?r$rBrrrrB�s�zBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32�frozenFr)�freeze_supportN)�sys�platform�getattr�spawnrE)rrErrrrE�szBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilrJ)rrJrrrrJ�szBaseContext.get_loggercCsddlm}||�S)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rKrL)r�levelrLrrrrL�szBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)rN)�r)rrrrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)rIrP)r�
executablerPrrrrP�szBaseContext.set_executablecCsddlm}||�dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrR)r�module_namesrRrrrrR�sz"BaseContext.set_forkserver_preloadcCsF|dur|Szt|}Wn ty8td|�d�Yn0|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�szBaseContext.get_contextFcCs|jS�N)�_name�r�
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rW�rrY�forcerrr�set_start_method�szBaseContext.set_start_methodcCst��d�S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rb)rrrrrre�scCsdSrZrrdrrrrX�szBaseContext._check_available)T)N)r)r)NN)r)r)NNrN)N)N)F)F)+rr	r
rrr
r�staticmethodr�current_process�parent_process�active_childrenrrrr r"r#r%r'r(r)r.r1r2r3r:r>r@rBrErJrLrOrPrRrr^ra�propertyre�setterrXrrrrrsR









�







rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�SrZ)�_default_contextrrl�_Popen)�process_objrrrrn�szProcess._Popen�rr	r
�
_start_methodrfrnrrrrrl�srlcsFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrZ)rm�_actual_context)rr4rrr�__init__�szDefaultContext.__init__Ncs0|dur |jdur|j|_|jSt��|�SdSrZ)rsrm�superr)rrY��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdur|std��|dur,|r,d|_dS|�|�|_dS)Nzcontext has already been set)rs�RuntimeErrorrr_rrrra�szDefaultContext.set_start_methodcCs"|jdur|rdS|j|_|jjSrZ)rsrmr[r\rrrr^�s

zDefaultContext.get_start_methodcCsBtjdkrdgStjdkr"ddgnddg}tjr:|�d�|SdS)NrCrI�darwin�forkrS)rFrGr�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methods)N)F)F)
rr	r
rlrtrrar^r~�
__classcell__rrrvrrr�s

rrrCc@seZdZdZedd��ZdS)�ForkProcessrzcCsddlm}||�S�Nr)�Popen)�
popen_forkr��ror�rrrrnszForkProcess._PopenNrprrrrr�sr�c@seZdZdZedd��ZdS)�SpawnProcessrIcCsddlm}||�Sr�)�popen_spawn_posixr�r�rrrrns�SpawnProcess._PopenNrprrrrr�sr�c@seZdZdZedd��ZdS)�ForkServerProcessrScCsddlm}||�Sr�)�popen_forkserverr�r�rrrrn szForkServerProcess._PopenNrprrrrr�sr�c@seZdZdZeZdS)�ForkContextrzN)rr	r
r[r�rlrrrrr�%sr�c@seZdZdZeZdS��SpawnContextrIN�rr	r
r[r�rlrrrrr�)sr�c@seZdZdZeZdd�ZdS)�ForkServerContextrScCstjstd��dS)Nz%forkserver start method not available)rr{rWrdrrrrX0sz"ForkServerContext._check_availableN)rr	r
r[r�rlrXrrrrr�-sr�)rzrIrSryrIrzc@seZdZdZedd��ZdS)r�rIcCsddlm}||�Sr�)Zpopen_spawn_win32r�r�rrrrnDsr�Nrprrrrr�Bsc@seZdZdZeZdSr�r�rrrrr�IscCst|t_dSrZ)rUrmrs)rYrrr�_force_start_methodVsr�cCsttdd�S)N�spawning_popen)rH�_tlsrrrr�get_spawning_popen_sr�cCs
|t_dSrZ)r�r�)�popenrrr�set_spawning_popenbsr�cCs t�durtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r�rx�typer)�objrrr�assert_spawninges
��r�) rrF�	threadingrNrr�__all__�	Exceptionrrr
r�objectr�BaseProcessrlrrrGr�r�r�r�r�r�rUrmr��localr�r�r�r�rrrr�<module>sJ?,��

Zerion Mini Shell 1.0