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

  • <small id='2ftgD'></small><noframes id='2ftgD'>

  • <legend id='2ftgD'><style id='2ftgD'><dir id='2ftgD'><q id='2ftgD'></q></dir></style></legend>

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

        <tfoot id='2ftgD'></tfoot>

        為什么 tkinter 不能很好地處理多處理?

        Why doesn#39;t tkinter play nicely with multiprocessing?(為什么 tkinter 不能很好地處理多處理?)

            <tbody id='NlAOr'></tbody>

          <legend id='NlAOr'><style id='NlAOr'><dir id='NlAOr'><q id='NlAOr'></q></dir></style></legend>
            <bdo id='NlAOr'></bdo><ul id='NlAOr'></ul>

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

                <i id='NlAOr'><tr id='NlAOr'><dt id='NlAOr'><q id='NlAOr'><span id='NlAOr'><b id='NlAOr'><form id='NlAOr'><ins id='NlAOr'></ins><ul id='NlAOr'></ul><sub id='NlAOr'></sub></form><legend id='NlAOr'></legend><bdo id='NlAOr'><pre id='NlAOr'><center id='NlAOr'></center></pre></bdo></b><th id='NlAOr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NlAOr'><tfoot id='NlAOr'></tfoot><dl id='NlAOr'><fieldset id='NlAOr'></fieldset></dl></div>
              1. <tfoot id='NlAOr'></tfoot>
                  本文介紹了為什么 tkinter 不能很好地處理多處理?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  以下代碼在linux中的python 3.2.2中沒有做任何事情就掛起:

                  The following code hangs without doing anything in python 3.2.2 in linux:

                  import tkinter
                  from multiprocessing import Process
                  
                  def f():
                      root = tkinter.Tk()
                      label = tkinter.Label(root)
                      label.pack()
                      root.mainloop()
                  
                  p = Process(target=f)
                  p.start()
                  

                  我找到的關于這個問題的唯一信息是 issue 5527,其中指出問題出在 tkinter 在進程被分叉之前被導入,可以通過在函數(shù) f 中導入 tkinter 來修復,并且該問題在 Linux 中出現(xiàn)但不是索拉里斯.

                  The only information I have found about this problem is issue 5527, in which it is noted that the problem is with tkinter being imported before the process is forked, that it can be fixed by importing tkinter inside the function f, and that the problem occurs in Linux but not Solaris.

                  有誰知道究竟是什么導致了這個問題,是故意的還是最終會得到解決?除了在我需要的任何地方本地導入 tkinter 之外,還有其他解決方法嗎(這看起來很糟糕)?其他模塊是否有類似的多處理問題?

                  Does anyone know what exactly is causing this problem, and if it is intentional or will eventually be fixed? Is there any workaround other than to import tkinter locally everywhere I need it (which seems like bad style)? Do any other modules have similar issues with multiprocessing?

                  推薦答案

                  截至 2013 年 9 月,有一些關于錯誤報告的附加評論可以讓您更深入地了解實際問題.

                  As of September 2013, there are some additional comments on the bug report that give more insight into what the actual problem is.

                  http://bugs.python.org/issue5527#msg194848
                  http://bugs.python.org/issue5527#msg195480

                  基于上述情況,我猜測正在發(fā)生以下情況:Tkinter 不是線程安全的,因此(無論出于何種原因)Tkinter 想知道哪個線程是主線程.Tkinter 假設加載 Tkinter 模塊時的主線程也將是程序執(zhí)行的主線程.當你在加載 Tkinter 后 fork 或 multiprocess 時,這個假設就被打破了.(例如,fork 后,記住的主線程在父線程,而不是子線程.)

                  Based on the above, I'm guessing something like the following is happening: Tkinter is not thread safe, so (for whatever reason) Tkinter wants to know which thread is the main thread. Tkinter assumes that the main thread when the Tkinter module is loaded will also be the main thread for program execution. When you fork or multiprocess after loading Tkinter, this assumption is broken. (For example, after a fork, the remembered main thread is in the parent, not the child.)

                  這篇關于為什么 tkinter 不能很好地處理多處理?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(liá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)

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

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

                        <tbody id='LyjUs'></tbody>
                          • <bdo id='LyjUs'></bdo><ul id='LyjUs'></ul>
                            <tfoot id='LyjUs'></tfoot>

                            <i id='LyjUs'><tr id='LyjUs'><dt id='LyjUs'><q id='LyjUs'><span id='LyjUs'><b id='LyjUs'><form id='LyjUs'><ins id='LyjUs'></ins><ul id='LyjUs'></ul><sub id='LyjUs'></sub></form><legend id='LyjUs'></legend><bdo id='LyjUs'><pre id='LyjUs'><center id='LyjUs'></center></pre></bdo></b><th id='LyjUs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LyjUs'><tfoot id='LyjUs'></tfoot><dl id='LyjUs'><fieldset id='LyjUs'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美精品久久久久 | 精品国产乱码久久久久久闺蜜 | 国产精品久久久久久妇女6080 | 欧美精品在线播放 | 日本高清视频在线播放 | 国产精品一区二区免费 | 成人精品国产免费网站 | 亚洲精品久久久久久国产精华液 | 91久久久久久久久久久久久 | 欧美一级免费看 | 一区二区三区四区国产 | 中文字幕av网 | 久久久久久久久淑女av国产精品 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 国产精品99久久久久久www | 久久精品播放 | www日韩欧美 | 性天堂网 | 亚洲一区二区国产 | 国产精品久久欧美久久一区 | 一区二区三区在线电影 | 色综合色综合色综合 | 麻豆av在线免费观看 | 日韩福利视频 | 国产精品久久久久久一级毛片 | 色在线免费视频 | 日本色高清 | www.av在线| 国产精品毛片一区二区在线看 | 久久99精品久久久久久国产越南 | 欧美成视频 | 日本在线视频不卡 | 亚洲国产一区二区视频 | 亚洲精品久久久久久久久久久 | 高清av在线 | 一级免费视频 | 国产7777 | 二区视频| 精品欧美一区二区在线观看欧美熟 | av在线播放网站 | 狠狠综合久久av一区二区小说 |