uawdijnntqw1x1x1
IP : 13.58.61.176
Hostname : host45.registrar-servers.com
Kernel : Linux host45.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
..
/
usr
/
lib64
/
python3.6
/
multiprocessing
/
__pycache__
/
forkserver.cpython-36.opt-1.pyc
/
/
3 \�!�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlm Z ddlm Z ddlmZddlm Z ddlmZddlmZd d ddgZd Zejd�ZGdd�de�Zddd�Zdd�Zdd�Zdd�Ze�ZejZejZejZejZdS)�N�)� connection)�process)� reduction)�semaphore_tracker)�spawn)�util�ensure_running�get_inherited_fds�connect_to_new_process�set_forkserver_preload��Qc@s4eZdZdd�Zdd�Zdd�Zdd�Zd d �ZdS)� ForkServercCs.d|_d|_d|_d|_tj�|_dg|_dS)N�__main__)�_forkserver_address�_forkserver_alive_fd�_forkserver_pid�_inherited_fds� threadingZLock�_lock�_preload_modules)�self�r�2/usr/lib64/python3.6/multiprocessing/forkserver.py�__init__!s zForkServer.__init__cCs&tdd�|jD��std��||_dS)z>Set list of module names to try to load in forkserver process.css|]}t|�tkVqdS)N)�type�str)�.0�modrrr� <genexpr>+sz4ForkServer.set_forkserver_preload.<locals>.<genexpr>z&module_names must be a list of stringsN)�allr� TypeError)rZ modules_namesrrrr)sz!ForkServer.set_forkserver_preloadcCs|jS)z�Return list of fds inherited from parent process. This returns None if the current process was not started by fork server. )r)rrrrr /szForkServer.get_inherited_fdscCs�|j�t|�dtkr td��tjtj���}|j|j�tj �\}}tj �\}}|||j tj�g}||7}z<yt j||�||fStj|�tj|��YnXWdtj|�tj|�XWdQRXdS)a;Request forkserver to create a child process. Returns a pair of fds (status_r, data_w). The calling process can read the child process's pid and (eventually) its returncode from status_r. The calling process should write to data_w the pickled preparation and process data. �ztoo many fdsN)r �len�MAXFDS_TO_SEND� ValueError�socket�AF_UNIXZconnectr�os�piperrZgetfdrZsendfds�close)r�fdsZclientZparent_r�child_w�child_rZparent_wZallfdsrrrr7s& z!ForkServer.connect_to_new_processcs�|j��ntj�|jdk rVtj|jtj�\}}|s8dStj|j�d|_ d|_d|_d}|j r�ddh�tjd�}t �fdd�|j�D��}ni}tjtj���}tjd �}|j|�tj|d �|j�tj�\}}ztyV|j�|g} ||j�||j |f;}tj�} | gtj�}|d|g7}tj| || �}Wntj|��YnXWdtj|�X||_ ||_||_WdQRXWdQRXdS) z�Make sure that a fork server is running. This can be called from any process. Note that usually a child process will just reuse the forkserver started by its parent, so ensure_running() will do nothing. Nz-from multiprocessing.forkserver import main; zmain(%d, %d, %r, **%r)� main_path�sys_path�ignorec3s"|]\}}|�kr||fVqdS)Nr)r�x�y)�desired_keysrrr osz,ForkServer.ensure_running.<locals>.<genexpr>r(i�z-czCfrom multiprocessing.forkserver import main; main(%d, %d, %r, **%r))rrr rr)�waitpid�WNOHANGr+rrrrZget_preparation_data�dict�itemsr'r(rZarbitrary_addressZbind�chmodZlistenr*�filenoZget_executablerZ_args_from_interpreter_flagsZspawnv_passfds)r�pidZstatus�cmd�data�listenerZaddress�alive_rZalive_wZfds_to_passZexe�argsr)r4rr TsL zForkServer.ensure_runningN)�__name__� __module__�__qualname__rrr rr rrrrrs rc4Cs�|rhd|kr8|dk r8dtj�_ztj|�Wdtj�`Xx.|D]&}yt|�Wq>tk rbYq>Xq>Wtj�t j t jt jt ji}dd�|j �D�}tjtj|d���,}tj���} |j�t_| j|tj�| j|tj�x�y�xdd�| j�D�} | r�Pq�W|| k�rt�|j�d �l}d }tj�d k�r�zFyt||||�Wn.tk �rntjtj ��tj!j"�YnXWdtj#|�XWdQRXWq�t$k �r�} z| j%t%j&k�r��WYdd} ~ Xq�Xq�WWdQRXWdQRXdS)zRun forkserver.rNTcSsi|]\}}tj||�|�qSr)�signal)r�sig�valrrr� <dictcomp>�szmain.<locals>.<dictcomp>)r:cSsg|]\}}|j�qSr)Zfileobj)r�keyZeventsrrr� <listcomp>�szmain.<locals>.<listcomp>rr)'rZcurrent_processZ_inheritingrZimport_main_path� __import__�ImportErrorrZ_close_stdinrD�SIGCHLD�SIG_IGN�SIGINTr8r'r(� selectorsZDefaultSelectorZgetsockname�_forkserverr�registerZ EVENT_READZselect� SystemExitZacceptr)�fork� _serve_one� Exception�sys� excepthook�exc_info�stderr�flush�_exit�OSError�errnoZECONNABORTED)Zlistener_fdr?Zpreloadr/r0�modname�handlersZold_handlersr>ZselectorZrfds�s�code�errr�main�sR rccCs�|j�tj|�x |j�D]\}}tj||�qWtj|td�}|j�|^}}t_} t_ | t j_t |tj��dtjkr�ddl} | j�tj|�}t ||�dS)Nr�randomr)r+r)r8rDrZrecvfdsr%rPrrrZ_semaphore_trackerZ_fd�write_unsigned�getpidrV�modulesrdZseedr�_main)r`r>r?r_rErFr,r.r-ZstfdrdrarrrrT�s rTcCsRd}tj}x8t|�|krBtj||t|��}|s8td��||7}qWtj|�dS)N�zunexpected EOFr)�UNSIGNED_STRUCT�sizer$r)�read�EOFErrorZunpack)�fdr=Zlengthr`rrr� read_unsigned�srocCs@tj|�}x0|r:tj||�}|dkr,td��||d�}qWdS)Nrzshould not get here)rjZpackr)�write�RuntimeError)rn�n�msg�nbytesrrrre�s re)NN)r]r)rOrDr'ZstructrVr�rr�contextrrrr�__all__r%ZStructrj�objectrrcrTrorerPr r rrrrrr�<module>s6 s =!
/home/../usr/lib64/python3.6/multiprocessing/__pycache__/forkserver.cpython-36.opt-1.pyc