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

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

      <tfoot id='CI25o'></tfoot>
      • <bdo id='CI25o'></bdo><ul id='CI25o'></ul>
    2. <small id='CI25o'></small><noframes id='CI25o'>

        Python 3.4 多處理遞歸 Pool.map()

        Python 3.4 multiprocessing recursive Pool.map()(Python 3.4 多處理遞歸 Pool.map())

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

          <legend id='f7y8C'><style id='f7y8C'><dir id='f7y8C'><q id='f7y8C'></q></dir></style></legend>

            <tfoot id='f7y8C'></tfoot>
              <bdo id='f7y8C'></bdo><ul id='f7y8C'></ul>

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

                • 本文介紹了Python 3.4 多處理遞歸 Pool.map()的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在 Ubuntu 14.04 上使用 Python 3.4 進行開發.我試圖做遞歸 Pool.map().在我調用 g() 之后,它掛在那里并且永遠不會返回.

                  I'm developing with Python 3.4 on Ubuntu 14.04. I was trying to do recursive Pool.map(). After I invoke g(), it hangs there and never returns.

                  import multiprocessing as mp
                  
                  pool = mp.Pool()
                  
                  def d(x):
                      return x / 2.0
                  
                  
                  def f(x):
                      w = pool.map(d, x)
                      return w
                  
                  def g():
                      v = pool.map(f, [[1, 2], [3, 4]])
                  
                      print(v)
                  

                  推薦答案

                  這是不可能的.Pool 對象本身不能安全地在進程之間共享,因此不能在 fg 中使用同一個池.即使您可以這樣做,也會很快導致掛起,因為您的池僅限于 cpu_count() 個并發工作人員.一旦你開始遞歸地創建更多的工人,你最終會得到超過 cpu_count() 個工人,這將永遠無法完成;正在運行的工作人員將等待池中排隊的任務,但排隊的任務將永遠無法啟動,因為正在運行的任務正在等待.所以你最終陷入僵局.簡而言之:不要嘗試這樣做.

                  This isn't possible. The Pool object itself can't safely be shared between processes, so the same pool can't be used in both f and g. Even if you could do this, you'd quickly cause a hang, because your pool is limited to cpu_count() concurrent workers. Once you start creating more workers recursively, you'll end up with more than cpu_count() workers, which will never be able to finish; the running workers would be waiting on tasks that are queued up in the pool, but the queued up tasks won't ever be able to start because the running tasks are waiting. So you end up deadlocked. In short: don't try to do this.

                  這篇關于Python 3.4 多處理遞歸 Pool.map()的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數傳遞給 pool.map() 函數)
                  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() 管理的函數?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯誤的另一個混淆,“模塊對象沒有屬性“f)
                  <legend id='MRYmr'><style id='MRYmr'><dir id='MRYmr'><q id='MRYmr'></q></dir></style></legend>
                  <tfoot id='MRYmr'></tfoot>
                    <tbody id='MRYmr'></tbody>
                      • <small id='MRYmr'></small><noframes id='MRYmr'>

                          <bdo id='MRYmr'></bdo><ul id='MRYmr'></ul>

                            <i id='MRYmr'><tr id='MRYmr'><dt id='MRYmr'><q id='MRYmr'><span id='MRYmr'><b id='MRYmr'><form id='MRYmr'><ins id='MRYmr'></ins><ul id='MRYmr'></ul><sub id='MRYmr'></sub></form><legend id='MRYmr'></legend><bdo id='MRYmr'><pre id='MRYmr'><center id='MRYmr'></center></pre></bdo></b><th id='MRYmr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MRYmr'><tfoot id='MRYmr'></tfoot><dl id='MRYmr'><fieldset id='MRYmr'></fieldset></dl></div>
                            主站蜘蛛池模板: 一级黄色短片 | 国产成人免费视频网站高清观看视频 | 国产91亚洲精品一区二区三区 | 亚州精品天堂中文字幕 | 欧美精品一区二区三区四区 | 亚洲精品在线视频 | 国产精品影视在线观看 | 综合久久久 | aaa天堂| 中文天堂在线一区 | 欧美日韩精品中文字幕 | heyzo在线| 免费一级大片 | 亚洲视频1区| 精品国产乱码久久久久久a丨 | 成人在线影视 | 午夜精品一区二区三区三上悠亚 | 欧美一级淫片免费视频黄 | 国产福利久久 | 国产精品区二区三区日本 | 欧美天堂 | 丁香综合 | 欧美天堂| 亚洲精品久久久久avwww潮水 | 久久不卡日韩美女 | 国产成人高清视频 | 久久亚洲一区二区三区四区 | 欧美黄色网络 | 国产成人一区二区三区精 | 欧美四虎 | 色婷婷综合久久久久中文一区二区 | 婷婷毛片| 欧美视频| 亚洲成人一区 | 中文字幕一区在线观看视频 | 日韩精品欧美精品 | 中文字幕亚洲视频 | 91精品一区二区三区久久久久久 | 色男人的天堂 | 91精品久久久久久久99 | 久久精品视频播放 |