File: //home/arjun/projects/env/lib/python3.10/site-packages/tornado/__pycache__/process.cpython-310.pyc
o
we�1 � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZmZm
Z
ddlmZ ddlmZ ddlmZ ddlZddlmZmZmZ ejrWdd lmZ ejZd
efdd�Zdd
d�Zda ddee dee d
efdd�Zd
ee fdd�Z G dd� de!�Z"dS )z�Utilities for working with multiple processes, including both forking
the server into multiple processes and managing subprocesses.
� N)�hexlify)�Future�"future_set_result_unless_cancelled�%future_set_exception_unless_cancelled)�ioloop)�PipeIOStream)�gen_log)�Optional�Any�Callable)�List�returnc C s\ t du rdS zt �� W S ty Y nw zt�d�W S ttfy& Y nw t�d� dS )z1Returns the number of processors on this machine.N� �SC_NPROCESSORS_CONFz1Could not detect number of processors; assuming 1) �multiprocessing� cpu_count�NotImplementedError�os�sysconf�AttributeError�
ValueErrorr �error� r r �H/home/arjun/projects/env/lib/python3.10/site-packages/tornado/process.pyr 1 s
��
r c C sh dt jvrd S dd l} zttt�d��d�}W n ty, tt�� d �t� � A }Y nw | �
|� d S )N�randomr � i� )�sys�modulesr �intr r �urandomr �time�getpid�seed)r r"