久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<legend id='potqy'><style id='potqy'><dir id='potqy'><q id='potqy'></q></dir></style></legend>
    <bdo id='potqy'></bdo><ul id='potqy'></ul>
<i id='potqy'><tr id='potqy'><dt id='potqy'><q id='potqy'><span id='potqy'><b id='potqy'><form id='potqy'><ins id='potqy'></ins><ul id='potqy'></ul><sub id='potqy'></sub></form><legend id='potqy'></legend><bdo id='potqy'><pre id='potqy'><center id='potqy'></center></pre></bdo></b><th id='potqy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='potqy'><tfoot id='potqy'></tfoot><dl id='potqy'><fieldset id='potqy'></fieldset></dl></div>
    1. <tfoot id='potqy'></tfoot>

      <small id='potqy'></small><noframes id='potqy'>

        Python 多處理的池進程限制

        Python multiprocessing#39;s Pool process limit(Python 多處理的池進程限制)
          <legend id='n34cA'><style id='n34cA'><dir id='n34cA'><q id='n34cA'></q></dir></style></legend>

            • <tfoot id='n34cA'></tfoot>

                  <tbody id='n34cA'></tbody>

                <small id='n34cA'></small><noframes id='n34cA'>

                <i id='n34cA'><tr id='n34cA'><dt id='n34cA'><q id='n34cA'><span id='n34cA'><b id='n34cA'><form id='n34cA'><ins id='n34cA'></ins><ul id='n34cA'></ul><sub id='n34cA'></sub></form><legend id='n34cA'></legend><bdo id='n34cA'><pre id='n34cA'><center id='n34cA'></center></pre></bdo></b><th id='n34cA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='n34cA'><tfoot id='n34cA'></tfoot><dl id='n34cA'><fieldset id='n34cA'></fieldset></dl></div>
                  <bdo id='n34cA'></bdo><ul id='n34cA'></ul>
                  本文介紹了Python 多處理的池進程限制的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  在使用多處理模塊的 Pool 對象時,進程數(shù)是否受 CPU 核數(shù)的限制?例如.如果我有 4 個核心,即使我創(chuàng)建一個包含 8 個進程的池,一次也只能運行 4 個?

                  In using the Pool object from the multiprocessing module, is the number of processes limited by the number of CPU cores? E.g. if I have 4 cores, even if I create a Pool with 8 processes, only 4 will be running at one time?

                  推薦答案

                  你可以要求盡可能多的進程.任何可能存在的限制都將由您的操作系統(tǒng)施加,而不是由 multiprocessing 施加.例如,

                  You can ask for as many processes as you like. Any limit that may exist will be imposed by your operating system, not by multiprocessing. For example,

                   p = multiprocessing.Pool(1000000)
                  

                  在任何機器上都可能遭受丑陋的死亡.當我輸入這個時,我正在我的盒子上嘗試它,并且操作系統(tǒng)正在將我的磁盤磨成灰塵,瘋狂地換出 RAM - 最后在它創(chuàng)建了大約 3000 個進程后將其殺死;-)

                  is likely to suffer an ugly death on any machine. I'm trying it on my box as I type this, and the OS is grinding my disk to dust swapping out RAM madly - finally killed it after it had created about 3000 processes ;-)

                  至于一次"運行多少個,Python 沒有發(fā)言權(quán).這取決于:

                  As to how many will run "at one time", Python has no say in that. It depends on:

                  1. 您有多少硬件能夠同時運行;并且,
                  2. 您的操作系統(tǒng)如何決定將硬件資源分配給您計算機上當前正在運行的所有進程.
                  1. How many your hardware is capable of running simultaneously; and,
                  2. How your operating system decides to give hardware resources to all the processes on your machine currently running.

                  對于 CPU 密集型任務(wù),創(chuàng)建比運行它們的內(nèi)核更多的 Pool 進程沒有意義.如果您也嘗試將您的機器用于其他事情,那么您應(yīng)該創(chuàng)建比內(nèi)核更少的進程.

                  For CPU-bound tasks, it doesn't make sense to create more Pool processes than you have cores to run them on. If you're trying to use your machine for other things too, then you should create fewer processes than cores.

                  對于 I/O 密集型任務(wù),可能創(chuàng)建比核心更多的 Pool 進程,因為這些進程可能會花費大部分時間阻塞(等待 I/O 完成).

                  For I/O-bound tasks, it may make sense to create a quite a few more Pool processes than cores, since the processes will probably spend most their time blocked (waiting for I/O to complete).

                  這篇關(guān)于Python 多處理的池進程限制的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數(shù)傳遞給 pool.map() 函數(shù))
                  multiprocessing.pool.MaybeEncodingError: #39;TypeError(quot;cannot serialize #39;_io.BufferedReader#39; objectquot;,)#39;(multiprocessing.pool.MaybeEncodingError: TypeError(cannot serialize _io.BufferedReader object,)) - IT屋-程序員軟件開
                  Python Multiprocess Pool. How to exit the script when one of the worker process determines no more work needs to be done?(Python 多進程池.當其中一個工作進程確定不再需要完成工作時,如何退出腳本?) - IT屋-程序員
                  How do you pass a Queue reference to a function managed by pool.map_async()?(如何將隊列引用傳遞給 pool.map_async() 管理的函數(shù)?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯誤的另一個混淆,“模塊對象沒有屬性“f)
                  <legend id='NvQHA'><style id='NvQHA'><dir id='NvQHA'><q id='NvQHA'></q></dir></style></legend>

                    <tfoot id='NvQHA'></tfoot>
                  1. <i id='NvQHA'><tr id='NvQHA'><dt id='NvQHA'><q id='NvQHA'><span id='NvQHA'><b id='NvQHA'><form id='NvQHA'><ins id='NvQHA'></ins><ul id='NvQHA'></ul><sub id='NvQHA'></sub></form><legend id='NvQHA'></legend><bdo id='NvQHA'><pre id='NvQHA'><center id='NvQHA'></center></pre></bdo></b><th id='NvQHA'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NvQHA'><tfoot id='NvQHA'></tfoot><dl id='NvQHA'><fieldset id='NvQHA'></fieldset></dl></div>

                        <tbody id='NvQHA'></tbody>
                      • <small id='NvQHA'></small><noframes id='NvQHA'>

                        • <bdo id='NvQHA'></bdo><ul id='NvQHA'></ul>

                          • 主站蜘蛛池模板: 黄色精品 | 亚洲精品一级 | 国产黄色在线观看 | 国产在线观看网站 | 欧美高清hd | 精品国产一区二区三区免费 | 国产目拍亚洲精品99久久精品 | 国产我和子的乱视频网站 | 日本网站免费在线观看 | 亚洲国产精品一区二区第一页 | 亚洲精品久久久一区二区三区 | 在线2区 | 精精国产xxxx视频在线播放 | 国产专区在线 | 久久久久久久久99精品 | 欧美精品一区二区三区蜜臀 | 亚洲第一av | 天天天天操 | 亚洲乱码一区二区 | 先锋av资源网 | 欧美99久久精品乱码影视 | 亚洲高清视频在线 | 国家一级黄色片 | 日本网站在线看 | 日韩中文字幕 | 蜜桃在线一区二区三区 | 精品久久久久久久久久久久久 | 国产精品视频在线免费观看 | 成人一区av | 六月成人网 | 亚洲视频在线看 | 99精品视频一区二区三区 | 91青娱乐在线 | 99这里只有精品视频 | 久久久久久亚洲精品 | 黄色片免费 | 久久免费精品视频 | 国产91在线播放 | www.久久99 | 天堂在线中文字幕 | 9久久婷婷国产综合精品性色 |