| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/lib/python2.7/dist-packages/twisted/python/ |
Upload File : |
ó
[³XMc @ s± d Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z d d l
m Z d d l m
Z
e ƒ Z d d
d „ ƒ YZ d d d „ ƒ YZ d S( s°
twisted.threadpool: a pool of threads to which we dispatch tasks.
In most cases you can just use reactor.callInThread and friends
instead of creating a thread pool directly.
iÿÿÿÿN( t logt contextt failure( t deprecatedModuleAttribute( t Versiont
ThreadPoolc B sé e Z d Z d Z d Z e Z e Z d Z d Z
e j Z
e e j ƒ Z d d d d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d
„ Z d „ Z d „ Z d
„ Z d „ Z d „ Z d „ Z d „ Z d d d „ Z d „ Z RS( s
This class (hopefully) generalizes the functionality of a pool of
threads to which work can be dispatched.
callInThread() and stop() should only be called from
a single thread, unless you make a subclass where stop() and
_startSomeWorkers() are synchronized.
i i i c C s| | d k s t d ƒ ‚ | | k s0 t d ƒ ‚ t j d ƒ | _ | | _ | | _ | | _ g | _ g | _ g | _ d S( s®
Create a new threadpool.
@param minthreads: minimum number of threads in the pool
@param maxthreads: maximum number of threads in the pool
i s minimum is negatives minimum is greater than maximumN( t AssertionErrort Queuet qt mint maxt namet waiterst threadst working( t selft
minthreadst
maxthreadsR ( ( s= /usr/lib/python2.7/dist-packages/twisted/python/threadpool.pyt __init__0 s c C s t | _ t | _ | j ƒ d S( s'
Start the threadpool.
N( t Falset joinedt Truet startedt adjustPoolsize( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/python/threadpool.pyt startB s c C sj | j d 7_ d | j p$ t | ƒ | j f } | j d | j d | ƒ } | j j | ƒ | j ƒ d S( Ni s PoolThread-%s-%st targetR ( t workersR t idt
threadFactoryt _workerR
t appendR ( R R t newThread( ( s= /usr/lib/python2.7/dist-packages/twisted/python/threadpool.pyt startAWorkerK s
"c C s# | j j t ƒ | j d 8_ d S( Ni ( R t putt
WorkerStopR ( R ( ( s= /usr/lib/python2.7/dist-packages/twisted/python/threadpool.pyt stopAWorkerR s c C s&