0x1949 Team - FAZEMRX - MANAGER
Edit File: process.cpython-310.pyc
o ��+g�| � @ s� d Z dZddlZddlmZ ddlZddlZddlZddl m Z ddlZddlZddl mZ ddlZddlZddlZe�� ZdaG dd � d �Zd d� Ze�e� dZd ZG dd� de�ZG dd� d�Zdd� ZG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de �Z"dd� Z#dd� Z$d.d d!�Z%d"d#� Z&G d$d%� d%ej'�Z(da)da*d&d'� Z+d(d)� Z,G d*d+� d+ej-�Z.G d,d-� d-ej/�Z0dS )/a- Implements ProcessPoolExecutor. The following diagram and text describe the data-flow through the system: |======================= In-process =====================|== Out-of-process ==| +----------+ +----------+ +--------+ +-----------+ +---------+ | | => | Work Ids | | | | Call Q | | Process | | | +----------+ | | +-----------+ | Pool | | | | ... | | | | ... | +---------+ | | | 6 | => | | => | 5, call() | => | | | | | 7 | | | | ... | | | | Process | | ... | | Local | +-----------+ | Process | | Pool | +----------+ | Worker | | #1..n | | Executor | | Thread | | | | | +----------- + | | +-----------+ | | | | <=> | Work Items | <=> | | <= | Result Q | <= | | | | +------------+ | | +-----------+ | | | | | 6: call() | | | | ... | | | | | | future | | | | 4, result | | | | | | ... | | | | 3, except | | | +----------+ +------------+ +--------+ +-----------+ +---------+ Executor.submit() called: - creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict - adds the id of the _WorkItem to the "Work Ids" queue Local worker thread: - reads work ids from the "Work Ids" queue and looks up the corresponding WorkItem from the "Work Items" dict: if the work item has been cancelled then it is simply removed from the dict, otherwise it is repackaged as a _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q" until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because calls placed in the "Call Q" can no longer be cancelled with Future.cancel(). - reads _ResultItems from "Result Q", updates the future stored in the "Work Items" dict and deletes the dict entry Process #1..n: - reads _CallItems from "Call Q", executes the calls, and puts the resulting _ResultItems in "Result Q" z"Brian Quinlan (brian@sweetapp.com)� N)�_base)�Queue)�partialFc @ s, e Zd Zdd� Zdd� Zdd� Zdd� Zd S ) � _ThreadWakeupc C s d| _ tjdd�\| _| _d S )NF)�duplex)�_closed�mp�Pipe�_reader�_writer��self� r �1/usr/lib/python3.10/concurrent/futures/process.py�__init__C s z_ThreadWakeup.__init__c C s( | j sd| _ | j�� | j�� d S d S �NT)r r �closer r r r r r G s �z_ThreadWakeup.closec C s | j s| j�d� d S d S )N� )r r � send_bytesr r r r �wakeupM s �z_ThreadWakeup.wakeupc C s0 | j s| j�� r| j�� | j�� sd S d S d S �N)r r �poll� recv_bytesr r r r �clearQ s ��z_ThreadWakeup.clearN)�__name__� __module__�__qualname__r r r r r r r r r B s r c C s@ da tt�� �} | D ]\}}|�� q | D ]\}}|�� qd S r )�_global_shutdown�list�_threads_wakeups�itemsr �join)r �_� thread_wakeup�tr r r �_python_exitW s �r% � �= c @ � e Zd Zdd� Zdd� ZdS )�_RemoteTracebackc C s || _ d S r ��tb)r r+ r r r r w s z_RemoteTraceback.__init__c C s | j S r r* r r r r �__str__y s z_RemoteTraceback.__str__N)r r r r r, r r r r r) v s r) c @ r( )�_ExceptionWithTracebackc C s8 t �t|�||�}d�|�}|| _d | j_d| | _d S )N� z """ %s""")� traceback�format_exception�typer! �exc� __traceback__r+ )r r2 r+ r r r r } s z _ExceptionWithTraceback.__init__c C s t | j| jffS r )�_rebuild_excr2 r+ r r r r � __reduce__� s z"_ExceptionWithTraceback.__reduce__N)r r r r r5 r r r r r- | s r- c C s t |�| _| S r )r) � __cause__)r2 r+ r r r r4 � s r4 c @ � e Zd Zdd� ZdS )� _WorkItemc C � || _ || _|| _|| _d S r )�future�fn�args�kwargs)r r: r; r<