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

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

  • <small id='RU6ne'></small><noframes id='RU6ne'>

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

        multiprocessing.Queue 項目的最大大小?

        Maximum size for multiprocessing.Queue item?(multiprocessing.Queue 項目的最大大小?)
          <bdo id='grba7'></bdo><ul id='grba7'></ul>
            <tbody id='grba7'></tbody>

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

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

                  <tfoot id='grba7'></tfoot>

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

                  本文介紹了multiprocessing.Queue 項目的最大大小?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Python 處理一個相當大的項目,該項目需要將計算密集型后臺任務之一卸載到另一個核心,以便不會降低主要服務的速度.在使用 multiprocessing.Queue 來傳達工作進程的結果時,我遇到了一些明顯奇怪的行為.為 threading.Threadmultiprocessing.Process 使用相同的隊列以進行比較,線程工作得很好,但在放入大項目后進程無法加入隊列.觀察:

                  I'm working on a fairly large project in Python that requires one of the compute-intensive background tasks to be offloaded to another core, so that the main service isn't slowed down. I've come across some apparently strange behaviour when using multiprocessing.Queue to communicate results from the worker process. Using the same queue for both a threading.Thread and a multiprocessing.Process for comparison purposes, the thread works just fine but the process fails to join after putting a large item in the queue. Observe:

                  import threading
                  import multiprocessing
                  
                  class WorkerThread(threading.Thread):
                      def __init__(self, queue, size):
                          threading.Thread.__init__(self)
                          self.queue = queue
                          self.size = size
                  
                      def run(self):
                          self.queue.put(range(size))
                  
                  
                  class WorkerProcess(multiprocessing.Process):
                      def __init__(self, queue, size):
                          multiprocessing.Process.__init__(self)
                          self.queue = queue
                          self.size = size
                  
                      def run(self):
                          self.queue.put(range(size))
                  
                  
                  if __name__ == "__main__":
                      size = 100000
                      queue = multiprocessing.Queue()
                  
                      worker_t = WorkerThread(queue, size)
                      worker_p = WorkerProcess(queue, size)
                  
                      worker_t.start()
                      worker_t.join()
                      print 'thread results length:', len(queue.get())
                  
                      worker_p.start()
                      worker_p.join()
                      print 'process results length:', len(queue.get())
                  

                  我發現這對于 size = 10000 工作正常,但對于 size = 100000 會掛在 worker_p.join().multiprocessing.Process 實例可以放入 multiprocessing.Queue 的內容是否存在一些固有的大小限制?還是我在這里犯了一些明顯的根本性錯誤?

                  I've seen that this works fine for size = 10000, but hangs at worker_p.join() for size = 100000. Is there some inherent size limit to what multiprocessing.Process instances can put in a multiprocessing.Queue? Or am I making some obvious, fundamental mistake here?

                  作為參考,我在 Ubuntu 10.04 上使用 Python 2.6.5.

                  For reference, I am using Python 2.6.5 on Ubuntu 10.04.

                  推薦答案

                  似乎底層管道已滿,因此在寫入管道時,饋線線程阻塞(實際上是在嘗試獲取保護管道免受并發訪問的鎖時).

                  Seems the underlying pipe is full, so the feeder thread blocks on the write to the pipe (actually when trying to acquire the lock protecting the pipe from concurrent access).

                  檢查這個問題http://bugs.python.org/issue8237

                  這篇關于multiprocessing.Queue 項目的最大大小?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                  <legend id='uFqGd'><style id='uFqGd'><dir id='uFqGd'><q id='uFqGd'></q></dir></style></legend>
                  • <bdo id='uFqGd'></bdo><ul id='uFqGd'></ul>

                        <tfoot id='uFqGd'></tfoot>
                            <tbody id='uFqGd'></tbody>
                          • <small id='uFqGd'></small><noframes id='uFqGd'>

                            <i id='uFqGd'><tr id='uFqGd'><dt id='uFqGd'><q id='uFqGd'><span id='uFqGd'><b id='uFqGd'><form id='uFqGd'><ins id='uFqGd'></ins><ul id='uFqGd'></ul><sub id='uFqGd'></sub></form><legend id='uFqGd'></legend><bdo id='uFqGd'><pre id='uFqGd'><center id='uFqGd'></center></pre></bdo></b><th id='uFqGd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uFqGd'><tfoot id='uFqGd'></tfoot><dl id='uFqGd'><fieldset id='uFqGd'></fieldset></dl></div>
                            主站蜘蛛池模板: 人人爽人人爽 | 天天躁日日躁狠狠躁2018小说 | 国产精品视频久久 | 国产成人精品一区二区三区网站观看 | 久久精品免费观看 | 欧美一级淫片免费视频黄 | 81精品国产乱码久久久久久 | 真人女人一级毛片免费播放 | 色免费看 | 色片在线观看 | 亚洲免费视频一区二区 | 国产亚洲精品a | 欧美一区二区三区在线 | 久久国产精品久久久久 | 在线免费观看黄色 | 中文字幕亚洲区 | 一区二区三区四区国产 | 伊人伊成久久人综合网站 | 久久久美女 | av日日操 | 超碰导航 | 日韩不卡视频在线 | 精品一区二区免费视频 | 日韩电影中文字幕 | 日本不卡免费新一二三区 | 国产精品久久久久久吹潮 | 91免费在线看 | 亚洲 中文 欧美 | 天堂在线网 | 黄色毛片大全 | 日韩欧美福利视频 | 免费在线一区二区 | 欧美成人精品激情在线观看 | 自拍视频国产 | 日韩插插| 国产精品一区二区在线 | 亚洲精品一区在线观看 | 午夜在线免费观看 | av在线免费观看不卡 | 羞羞的视频在线观看 | 成人在线免费观看视频 |