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

    <tfoot id='yy3jY'></tfoot>
  • <small id='yy3jY'></small><noframes id='yy3jY'>

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

        多處理 AsyncResult.get() 在 Python 3.7.2 中掛起,但在

        Multiprocessing AsyncResult.get() hangs in Python 3.7.2 but not in 3.6(多處理 AsyncResult.get() 在 Python 3.7.2 中掛起,但在 3.6 中沒有)

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

      2. <legend id='nL8iu'><style id='nL8iu'><dir id='nL8iu'><q id='nL8iu'></q></dir></style></legend>

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

                1. 本文介紹了多處理 AsyncResult.get() 在 Python 3.7.2 中掛起,但在 3.6 中沒有的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在嘗試將一些代碼從 Python 3.6 移植到 Windows 10 上的 Python 3.7.在 AsyncResult 上調用 .get() 時,我看到多處理代碼掛起目的.有問題的代碼要復雜得多,但我已將其歸結為類似于以下程序的代碼.

                  I'm trying to port some code from Python 3.6 to Python 3.7 on Windows 10. I see the multiprocessing code hang when calling .get() on the AsyncResult object. The code in question is much more complicated, but I've boiled it down to something similar to the following program.

                  import multiprocessing
                  
                  
                  def main(num_jobs):
                      num_processes = max(multiprocessing.cpu_count() - 1, 1)
                      pool = multiprocessing.Pool(num_processes)
                  
                      func_args = []
                      results = []
                  
                      try:
                          for num in range(num_jobs):
                              args = (1, 2, 3)
                              func_args.append(args)
                              results.append(pool.apply_async(print, args))
                  
                          for result, args in zip(results, func_args):
                              print('waiting on', args)
                              result.get()
                      finally:
                          pool.terminate()
                          pool.join()
                  
                  
                  if __name__ == '__main__':
                      main(5)
                  

                  此代碼也在 Python 2.7 中運行.出于某種原因,對 get() 的第一次調用在 3.7 中掛起,但在其他版本上一切正常.

                  This code also runs in Python 2.7. For some reason the first call to get() hangs in 3.7, but everything works as expected on other versions.

                  推薦答案

                  我認為這是 Python 3.7.2 中描述的回歸 這里.它似乎只在 virtualenv 中運行時影響用戶.

                  I think this is a regression in Python 3.7.2 as described here. It seems to only affect users when running in a virtualenv.

                  暫時您可以通過執行在此錯誤線程的評論中描述的操作來解決它.

                  import _winapi
                  import multiprocessing.spawn
                  multiprocessing.spawn.set_executable(_winapi.GetModuleFileName(0))
                  

                  這將強制子進程使用 real python.exe 而不是 virtualenv 中的那個生成.因此,如果您使用 PyInstaller 將內容捆綁到 exe 中,這可能不合適,但在使用本地 Python 安裝從 CLI 運行時,它可以正常工作.

                  That will force the subprocesses to spawn using the real python.exe instead of the one that's in the virtualenv. So, this may not be suitable if you're bundling things into an exe with PyInstaller, but it works OK when running from the CLI with local Python installation.

                  這篇關于多處理 AsyncResult.get() 在 Python 3.7.2 中掛起,但在 3.6 中沒有的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                    <tbody id='RoXIJ'></tbody>

                      <tfoot id='RoXIJ'></tfoot>
                      <legend id='RoXIJ'><style id='RoXIJ'><dir id='RoXIJ'><q id='RoXIJ'></q></dir></style></legend>

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

                          • 主站蜘蛛池模板: 久久精品国产a三级三级三级 | 免费看国产片在线观看 | 亚洲精品一区二区三区免 | 天天操天天射综合 | 夜夜草视频 | 久久久精 | 日韩三区 | 一级特黄a大片 | 国产精品一区久久久 | 久久免费精品视频 | 欧美日韩免费视频 | 精品久久久久久亚洲综合网 | 国产欧美精品一区二区三区 | 日本免费一区二区三区四区 | 91精品久久久久久久 | 久久久久午夜 | 亚洲日韩中文字幕一区 | 一区二区三区在线 | 欧 | 在线看片网站 | 日本亚洲欧美 | 福利片在线| 久久久久国产一区二区三区四区 | 国产精品美女久久久 | 麻豆久久久久久久 | 青青草原综合久久大伊人精品 | 国产乡下妇女做爰 | 日韩成人精品一区二区三区 | 日本精品一区二区三区在线观看 | 国产高清视频在线观看 | 本道综合精品 | 欧美性受xxxx| 在线成人精品视频 | 国产一二三视频在线观看 | 国产乱肥老妇国产一区二 | 成人午夜精品 | 成人国产精品免费观看视频 | 国产精品免费播放 | 久久av一区| 国产黄色在线观看 | 国产精品久久久久久久模特 | 美国av片在线观看 |