/usr/lib64/python3.9/concurrent/futures/__pycache__
NameSizeModeActions
process.cpython-39.opt-1.pyc212290644editdlrm
process.cpython-39.opt-2.pyc158730644editdlrm
process.cpython-39.pyc213960644editdlrm
thread.cpython-39.opt-1.pyc59060644editdlrm
thread.cpython-39.opt-2.pyc53600644editdlrm
thread.cpython-39.pyc59060644editdlrm
_base.cpython-39.opt-1.pyc224360644editdlrm
_base.cpython-39.opt-2.pyc143940644editdlrm
_base.cpython-39.pyc224360644editdlrm
__init__.cpython-39.opt-1.pyc11100644editdlrm
__init__.cpython-39.opt-2.pyc10340644editdlrm
__init__.cpython-39.pyc11100644editdlrm
Edit: /usr/lib64/python3.9/concurrent/futures/__pycache__/process.cpython-39.opt-2.pyc (15873B)
a ´i£zã@s~dZddlZddlmZddlZddlZddlZddlm Z ddl Z ddl Z ddl m Z ddlZddlZddlZe  ¡ZdaGdd„dƒZd d „Ze  e¡d Zd ZGd d„deƒZGdd„dƒZdd„ZGdd„deƒZGdd„deƒZGdd„deƒZ Gdd„de ƒZ!dd„Z"dd„Z#d-dd „Z$d!d"„Z%Gd#d$„d$e j&ƒZ'da(da)d%d&„Z*d'd(„Z+Gd)d*„d*ej,ƒZ-Gd+d,„d,ej.ƒZ/dS).z"Brian Quinlan (brian@sweetapp.com)éN)Ú_base)ÚQueue)ÚpartialFc@s,eZdZdd„Zdd„Zdd„Zdd„Zd S) Ú _ThreadWakeupcCsd|_tjdd�\|_|_dS)NF)Úduplex)Ú_closedÚmpÚPipeÚ_readerÚ_writer©Úself©rú2/usr/lib64/python3.9/concurrent/futures/process.pyÚ__init__Csz_ThreadWakeup.__init__cCs$|js d|_|j ¡|j ¡dS©NT)rr Úcloser r rrrrGs z_ThreadWakeup.closecCs|js|j d¡dS)Nó)rr Ú send_bytesr rrrÚwakeupMsz_ThreadWakeup.wakeupcCs |js|j ¡r|j ¡qdS©N)rr ÚpollÚ recv_bytesr rrrÚclearQs z_ThreadWakeup.clearN)Ú__name__Ú __module__Ú __qualname__rrrrrrrrrBsrcCs@datt ¡ƒ}|D]\}}| ¡q|D]\}}| ¡q*dSr)Ú_global_shutdownÚlistÚ_threads_wakeupsÚitemsrÚjoin)r Ú_Ú thread_wakeupÚtrrrÚ _python_exitWs     r%éé=c@seZdZdd„Zdd„ZdS)Ú_RemoteTracebackcCs ||_dSr©Útb)r r*rrrrwsz_RemoteTraceback.__init__cCs|jSrr)r rrrÚ__str__ysz_RemoteTraceback.__str__N)rrrrr+rrrrr(vsr(c@seZdZdd„Zdd„ZdS)Ú_ExceptionWithTracebackcCs8t t|ƒ||¡}d |¡}||_d|j_d||_dS)NÚz """ %s""")Ú tracebackÚformat_exceptionÚtyper!ÚexcÚ __traceback__r*)r r1r*rrrr}s  z _ExceptionWithTraceback.__init__cCst|j|jffSr)Ú _rebuild_excr1r*r rrrÚ __reduce__…sz"_ExceptionWithTraceback.__reduce__N)rrrrr4rrrrr,|sr,cCst|ƒ|_|Sr)r(Ú __cause__)r1r*rrrr3ˆs r3c@seZdZdd„ZdS)Ú _WorkItemcCs||_||_||_||_dSr)ÚfutureÚfnÚargsÚkwargs)r r7r8r9r:rrrr�sz_WorkItem.__init__N©rrrrrrrrr6Œsr6c@seZdZddd„ZdS)Ú _ResultItemNcCs||_||_||_dSr)Úwork_idÚ exceptionÚresult)r r=r>r?rrrr”sz_ResultItem.__init__)NNr;rrrrr<“sr<c@seZdZdd„ZdS)Ú _CallItemcCs||_||_||_||_dSr)r=r8r9r:)r r=r8r9r:rrrršsz_CallItem.__init__Nr;rrrrr@™sr@cs*eZdZd‡fdd„ Z‡fdd„Z‡ZS)Ú _SafeQueuercs&||_||_||_tƒj||d�dS)N)Úctx)Úpending_work_itemsÚ shutdown_lockr#Úsuperr)r Úmax_sizerBrCrDr#©Ú __class__rrr£sz_SafeQueue.__init__csœt|tƒrŠt t|ƒ||j¡}td d |¡¡ƒ|_ |j   |j d¡}|j �|j ¡Wdƒn1sj0Y|dur˜|j |¡ntƒ ||¡dS)Nz """ {}"""r-)Ú isinstancer@r.r/r0r2r(Úformatr!r5rCÚpopr=rDr#rr7Ú set_exceptionrEÚ_on_queue_feeder_error)r ÚeÚobjr*Ú work_itemrGrrrMªs (z!_SafeQueue._on_queue_feeder_error)r)rrrrrMÚ __classcell__rrrGrrA¡srAcgs,t|Ž}tt ||¡ƒ}|s dS|VqdSr)ÚzipÚtupleÚ itertoolsÚislice)Ú chunksizeÚ iterablesÚitÚchunkrrrÚ _get_chunksºs rZcs‡fdd„|DƒS)Ncsg|] }ˆ|Ž‘qSrr)Ú.0r9©r8rrÚ Írz"_process_chunk..r)r8rYrr\rÚ_process_chunkÄs r^c Cs`z| t|||d�¡WnBtyZ}z*t||jƒ}| t||d�¡WYd}~n d}~00dS)N)r?r>©r>)Úputr<Ú BaseExceptionr,r2)Ú result_queuer=r?r>rNr1rrrÚ_sendback_resultÐs ÿ  rcc CsÔ|dur:z ||ŽWn$ty8tjjddd�YdS0|jdd�}|dur`| t ¡¡dSz|j|j i|j ¤Ž}Wn@ty¸}z(t ||j ƒ}t ||j|d�WYd}~nd}~00t ||j|d�~~q:dS)NzException in initializer:T)Úexc_info©Úblockr_)r?)rarÚLOGGERÚcriticalÚgetr`ÚosÚgetpidr8r9r:r,r2rcr=)Ú call_queuerbÚ initializerÚinitargsÚ call_itemÚrrNr1rrrÚ_process_workerÚs$     &rqcsleZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z ‡ZS)Ú_ExecutorManagerThreadcsf|j|_|j|_|j|jfdd„}t ||¡|_|j|_|j |_ |j |_ |j |_|j|_tƒ ¡dS)NcSs<tj d¡|�| ¡Wdƒn1s.0YdS)Nz?Executor collected: triggering callback for QueueManager wakeup)rÚutilÚdebugr)r"r#rDrrrÚ weakref_cbs z3_ExecutorManagerThread.__init__..weakref_cb)Ú_executor_manager_thread_wakeupr#Ú_shutdown_lockrDÚweakrefÚrefÚexecutor_referenceÚ _processesÚ processesÚ _call_queuerlÚ _result_queuerbÚ _work_idsÚwork_ids_queueÚ_pending_work_itemsrCrEr)r ÚexecutorrurGrrrs þ z_ExecutorManagerThread.__init__cCs€| ¡| ¡\}}}|r(| |¡dS|durX| |¡~| ¡}|durV|j ¡~| ¡r| ¡|j s|  ¡dSqdSr) Úadd_call_item_to_queueÚwait_result_broken_or_wakeupÚterminate_brokenÚprocess_result_itemrzÚ_idle_worker_semaphoreÚreleaseÚis_shutting_downÚflag_executor_shutting_downrCÚjoin_executor_internals)r Ú result_itemÚ is_brokenÚcauser‚rrrÚrun:s"   z_ExecutorManagerThread.runcCs~|j ¡rdSz|jjdd�}Wntjy6YdS0|j|}|j ¡rn|jj t ||j |j |j ƒdd�q|j|=qqdS)NFreT)rlÚfullr€riÚqueueÚEmptyrCr7Úset_running_or_notify_cancelr`r@r8r9r:)r r=rPrrrrƒZs"    ýüz-_ExecutorManagerThread.add_call_item_to_queuec Csæ|jj}|jj}||g}dd„t|j ¡ƒDƒ}tj ||¡}d}d}d}||vr z|  ¡}d}Wq¬t yœ} z t   t | ƒ| | j¡}WYd} ~ q¬d} ~ 00n ||vr¬d}|j�|j ¡Wdƒn1sÒ0Y|||fS)NcSsg|] }|j‘qSr)Úsentinel©r[Úprrrr]{rzG_ExecutorManagerThread.wait_result_broken_or_wakeup..TF)rbr r#rr|ÚvaluesrÚ connectionÚwaitÚrecvrar.r/r0r2rDr) r Ú result_readerÚ wakeup_readerÚreadersÚworker_sentinelsÚreadyrŽr�rŒrNrrrr„qs&,(z3_ExecutorManagerThread.wait_result_broken_or_wakeupcCsrt|tƒr2|j |¡}| ¡|jsn| ¡dSn<|j |jd¡}|durn|jr`|j   |j¡n|j   |j ¡dSr) rIÚintr|rKr!r‹rCr=r>r7rLÚ set_resultr?)r rŒr–rPrrrr†�s  z*_ExecutorManagerThread.process_result_itemcCs| ¡}tp|dup|jSr)rzrÚ_shutdown_thread)r r‚rrrr‰§s ÿz'_ExecutorManagerThread.is_shutting_downcCs˜| ¡}|dur d|_d|_d}tdƒ}|durHtdd |¡›d�ƒ|_|j ¡D]\}}|j   |¡~qR|j  ¡|j   ¡D] }| ¡q~| ¡dS)NzKA child process terminated abruptly, the process pool is not usable anymoreTz^A process in the process pool was terminated abruptly while the future was running or pending.z ''' r-z''')rzÚ_brokenr¢ÚBrokenProcessPoolr(r!r5rCr r7rLrr|r—Ú terminater‹)r rŽr‚Úbper=rPr–rrrr…±s"ÿ   z'_ExecutorManagerThread.terminate_brokencCs€| ¡}|dur|d|_|jr|i}|j ¡D]\}}|j ¡s*|||<q*||_z|j ¡WqLt j yrYqvYqL0qLd|_dS)NTF) rzr¢Ú_cancel_pending_futuresrCr r7Úcancelr€Ú get_nowaitr‘r’)r r‚Únew_pending_work_itemsr=rPrrrrŠ×s   z2_ExecutorManagerThread.flag_executor_shutting_downc Csl| ¡}d}||krh| ¡dkrht||ƒD]8}z|j d¡|d7}Wq,tjybYq Yq,0q,q dS)Nrr&)Úget_n_children_aliveÚrangerlÚ put_nowaitr‘ÚFull)r Ún_children_to_stopÚn_sentinels_sentÚirrrÚshutdown_workersñs ÿ  z'_ExecutorManagerThread.shutdown_workerscCsh| ¡|j ¡|j ¡|j�|j ¡Wdƒn1sB0Y|j ¡D] }| ¡qVdSr) r²rlrÚ join_threadrDr#r|r—r!©r r–rrrr‹ÿs  (z._ExecutorManagerThread.join_executor_internalscCstdd„|j ¡DƒƒS)Ncss|]}| ¡VqdSr)Úis_aliver•rrrÚ rz>_ExecutorManagerThread.get_n_children_alive..)Úsumr|r—r rrrr« sz+_ExecutorManagerThread.get_n_children_alive)rrrrr�rƒr„r†r‰r…rŠr²r‹r«rQrrrGrrrs +  & rrc Cshtrtrttƒ‚dazt d¡}Wnttfy:YdS0|dkrHdS|dkrTdSd|attƒ‚dS)NTÚSC_SEM_NSEMS_MAXéÿÿÿÿéz@system provides too few semaphores (%d available, 256 necessary))Ú_system_limits_checkedÚ_system_limitedÚNotImplementedErrorrjÚsysconfÚAttributeErrorÚ ValueError)Ú nsems_maxrrrÚ_check_system_limitss ÿrÂccs&|D]}| ¡|r| ¡VqqdSr)ÚreverserK)ÚiterableÚelementrrrÚ_chain_from_iterable_of_lists,srÆc@s eZdZdS)r¤N)rrrrrrrr¤8sr¤cs~eZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Ze j jj e_ dddœ‡fdd„ Z dddœdd„Z e j j j e _ ‡ZS)ÚProcessPoolExecutorNrcCsJtƒ|dur6t ¡pd|_tjdkrntt|jƒ|_n8|dkrHtdƒ‚n tjdkrh|tkrhtdt›�ƒ‚||_|dur~t   ¡}||_ |j j dd�dk|_ |dur°t|ƒs°td ƒ‚||_||_d|_i|_d|_t ¡|_t d¡|_d|_d|_i|_d|_tƒ|_|jt }t!||j |j|j|jd �|_"d |j"_#| $¡|_%t& '¡|_(dS) Nr&Úwin32rz"max_workers must be greater than 0zmax_workers must be <= F)Ú allow_noneÚforkzinitializer must be a callable)rFrBrCrDr#T))rÂrjÚ cpu_countÚ _max_workersÚsysÚplatformÚminÚ_MAX_WINDOWS_WORKERSrÀrÚ get_contextÚ _mp_contextÚget_start_methodÚ#_safe_to_dynamically_spawn_childrenÚcallableÚ TypeErrorÚ _initializerÚ _initargsÚ_executor_manager_threadr{r¢Ú threadingÚLockrwÚ Semaphorer‡r£Ú _queue_countr�r§rrvÚEXTRA_QUEUED_CALLSrAr}Ú _ignore_epipeÚ SimpleQueuer~r‘rr)r Ú max_workersÚ mp_contextrmrnÚ queue_sizerrrr@sZ  ÿ  ÿÿÿ    ü zProcessPoolExecutor.__init__cCs<|jdur8|js| ¡t|ƒ|_|j ¡|jt|j<dSr)rÙrÔÚ_launch_processesrrÚstartrvrr rrrÚ_start_executor_manager_thread•s   ÿz2ProcessPoolExecutor._start_executor_manager_threadcCs2|jjdd�rdSt|jƒ}||jkr.| ¡dS)NF)Úblocking)r‡ÚacquireÚlenr{rÌÚ_spawn_process)r Ú process_countrrrÚ_adjust_process_countŸs   z)ProcessPoolExecutor._adjust_process_countcCs$tt|jƒ|jƒD] }| ¡qdSr)r¬rér{rÌrê)r r"rrrrä®sz%ProcessPoolExecutor._launch_processescCs8|jjt|j|j|j|jfd�}| ¡||j|j <dS)N)Útargetr9) rÒÚProcessrqr}r~r×rØrår{Úpidr´rrrrê¶sýþz"ProcessPoolExecutor._spawn_processcOs¶|j�œ|jrt|jƒ‚|jr&tdƒ‚tr2tdƒ‚t ¡}t||||ƒ}||j |j <|j   |j ¡|j d7_ |j  ¡|jrˆ| ¡| ¡|WdƒS1s¨0YdS)Nz*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdownr&)rwr£r¤r¢Ú RuntimeErrorrrÚFuturer6r�rÝrr`rvrrÔrìræ)r r8r9r:ÚfÚwrrrÚsubmitÀs"   zProcessPoolExecutor.submitr&)ÚtimeoutrVcs:|dkrtdƒ‚tƒjtt|ƒt|d|iŽ|d�}t|ƒS)Nr&zchunksize must be >= 1.rV)rõ)rÀrEÚmaprr^rZrÆ)r r8rõrVrWÚresultsrGrrröÙs þzProcessPoolExecutor.mapTF)Úcancel_futurescCs˜|j�0||_d|_|jdur(|j ¡Wdƒn1s<0Y|jdur^|r^|j ¡d|_d|_|jdur‚|r‚|j  ¡d|_d|_ d|_dSr) rwr§r¢rvrrÙr!r}r~rr{)r r™rørrrÚshutdownös (  zProcessPoolExecutor.shutdown)NNNr)T)rrrrrærìrärêrôrÚExecutorÚ__doc__rörùrQrrrGrrÇ?sÿ U   rÇ)NN)0Ú __author__rjÚconcurrent.futuresrr‘ÚmultiprocessingrÚmultiprocessing.connectionÚmultiprocessing.queuesrrÚrxÚ functoolsrrTrÍr.ÚWeakKeyDictionaryrrrr%Ú_register_atexitrÞrÐÚ Exceptionr(r,r3Úobjectr6r<r@rArZr^rcrqÚThreadrrr»r¼rÂrÆÚBrokenExecutorr¤rúrÇrrrrÚ.sN       )