久久久久久久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 中沒有的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號(hào)..

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

                  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 中運(yùn)行.出于某種原因,對(duì) get() 的第一次調(diào)用在 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.

                  推薦答案

                  我認(rèn)為這是 Python 3.7.2 中描述的回歸 這里.它似乎只在 virtualenv 中運(yùn)行時(shí)影響用戶.

                  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.

                  暫時(shí)您可以通過執(zhí)行在此錯(cuò)誤線程的評(píng)論中描述的操作來解決它.

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

                  這將強(qiáng)制子進(jìn)程使用 real python.exe 而不是 virtualenv 中的那個(gè)生成.因此,如果您使用 PyInstaller 將內(nèi)容捆綁到 exe 中,這可能不合適,但在使用本地 Python 安裝從 CLI 運(yùn)行時(shí),它可以正常工作.

                  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.

                  這篇關(guān)于多處理 AsyncResult.get() 在 Python 3.7.2 中掛起,但在 3.6 中沒有的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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 中將多個(gè)參數(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 多進(jìn)程池.當(dāng)其中一個(gè)工作進(jìn)程確定不再需要完成工作時(shí),如何退出腳本?) - IT屋-程序員
                  How do you pass a Queue reference to a function managed by pool.map_async()?(如何將隊(duì)列引用傳遞給 pool.map_async() 管理的函數(shù)?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯(cuò)誤的另一個(gè)混淆,“模塊對(duì)象沒有屬性“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ⅴ国产精品 | 91在线观看免费 | 夜夜骑首页 | 91久久精品国产91久久性色tv | 欧日韩在线| 成人福利视频网站 | 国产福利在线看 | 亚洲免费一区二区 | 日本视频一区二区三区 | 一区二区三区高清在线观看 | 日韩有码一区 | 欧美一级电影免费 | 欧美成人h版在线观看 | 成人免费网站在线 | 国产精品美女久久久久aⅴ国产馆 | 久久999| 亚洲精品女优 | 国产wwwcom | 播放一级黄色片 | 久久伦理中文字幕 | 性色av一区二区三区 | 亚洲电影在线播放 | 国产91成人 | 免费观看一级视频 | 国产高清一区二区 | 九九热在线免费观看 | 香蕉久久a毛片 | 无吗视频 | 欧美日韩久 | 精品一区精品二区 | 丁香综合 | 中文字幕在线看人 | 在线视频久久 | 成人影院网站ww555久久精品 | 一区二区三区四区免费视频 | 国产伦精品一区二区三区照片91 | 成人av电影天堂 | 欧美一区二区三区视频在线播放 | 欧美一级特黄aaa大片在线观看 |