久久久久久久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>
                            主站蜘蛛池模板: 黄色免费在线观看网站 | 久久免费视频观看 | 国产一区91精品张津瑜 | 夜夜骑av| 日韩在线视频一区二区三区 | 成人久久久| 伊人久久综合 | 日韩在线| 成年人网站在线观看视频 | 亚洲一一在线 | 人人擦人人 | 91中文视频 | 又黑又粗又长的欧美一区 | 成人福利网站 | 色接久久 | 欧美一区二区三区久久精品 | 亚洲欧美日韩在线一区二区 | 国产高清在线视频 | 久久精品视频在线免费观看 | 国产精品7777777| 久久精品一区二区三区四区 | 不卡欧美 | 国产精品久久777777 | 日韩另类 | 国产精品久久国产精品 | 国产精品99999 | 中文字幕亚洲视频 | 中文字幕欧美一区 | 日日操夜夜摸 | 北条麻妃一区二区三区在线视频 | 九一视频在线观看 | 欧美成人精品欧美一级 | 在线观看涩涩视频 | 国产精品视频免费观看 | 国产精品有限公司 | 久久久久久91 | 欧美日高清 | 午夜精品久久久久久久久久久久久 | 国产高清在线精品一区二区三区 | 久久久久国产精品午夜一区 | 国产精品自产拍在线观看蜜 |