File: //lib64/python3.6/site-packages/tornado/__pycache__/process.cpython-36.pyc
3
��f2 � @ sD d Z ddlZddlZddlZddlZddlZddlZddlZddlm Z ddl
mZmZm
Z
ddlmZ ddlmZ ddlmZ ddlmZ dd lmZ ddlZdd
lmZmZmZmZ ejr�ddlmZ ejZe d�d
d�Z!dd�dd�Z"ee e f d�dd�Z#da$dee e e d�dd�Z%ee d�dd�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)�set_close_exec)�errno_from_exception)�Tuple�Optional�Any�Callable)�List)�returnc C s\ t dkrdS yt j� S tk
r( Y nX y
tjd�S ttfk
rL Y nX tjd� 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 �/usr/lib64/python3.6/process.pyr 3 s
r c C sj dt jkrd S dd l} ytttjd��d�}W n, tk
rZ ttj� d �tj � A }Y nX | j
|� d S )N�randomr � i� )�sys�modulesr �intr r �urandomr �time�getpid�seed)r r% r r r �_reseed_randomC s
r&