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

  • <tfoot id='SwyBc'></tfoot>
      • <bdo id='SwyBc'></bdo><ul id='SwyBc'></ul>

      1. <small id='SwyBc'></small><noframes id='SwyBc'>

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

        <i id='SwyBc'><tr id='SwyBc'><dt id='SwyBc'><q id='SwyBc'><span id='SwyBc'><b id='SwyBc'><form id='SwyBc'><ins id='SwyBc'></ins><ul id='SwyBc'></ul><sub id='SwyBc'></sub></form><legend id='SwyBc'></legend><bdo id='SwyBc'><pre id='SwyBc'><center id='SwyBc'></center></pre></bdo></b><th id='SwyBc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SwyBc'><tfoot id='SwyBc'></tfoot><dl id='SwyBc'><fieldset id='SwyBc'></fieldset></dl></div>
      3. Python 線程 stack_size 和 segfaults

        Python threads stack_size and segfaults(Python 線程 stack_size 和 segfaults)
        • <bdo id='GiZES'></bdo><ul id='GiZES'></ul>

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

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

                    <tbody id='GiZES'></tbody>

                  本文介紹了Python 線程 stack_size 和 segfaults的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  一個網絡爬蟲腳本,最多生成 500 個線程,每個線程基本上都請求從遠程服務器提供的某些數據,每個服務器的回復在內容和大小上都與其他服務器不同.

                  A web crawler script that spawns at most 500 threads and each thread basically requests for certain data served from the remote server, which each server's reply is different in content and size from others.

                  我將線程的 stack_size 設置為 756K

                  i'm setting stack_size as 756K's for threads

                  threading.stack_size(756*1024)
                  

                  這使我能夠擁有足夠數量的所需線程并完成大部分作業和請求.但是由于某些服務器的響應比其他服務器大,并且當一個線程獲得這種響應時,腳本會因 SIGSEGV 而死.

                  which enables me to have the sufficient number of threads required and complete most of the jobs and requests. But as some servers' responses are bigger than others, and when a thread gets that kind of response, script dies with SIGSEGV.

                  stack_sizes 超過 756K 使得不可能同時擁有所需數量的線程.

                  stack_sizes more than 756K makes it impossible to have the required number of threads at the same time.

                  關于如何在不崩潰的情況下繼續使用給定的 stack_size 的任何建議?以及如何獲取任何給定線程的當前使用的 stack_size?

                  any suggestions on how can i continue with given stack_size without crashes? and how can i get the current used stack_size of any given thread?

                  推薦答案

                  為什么你到底要生成 500 個線程?這似乎是一個可怕的主意!

                  Why on earth are you spawning 500 threads? That seems like a terrible idea!

                  完全刪除線程,使用事件循環進行爬取.您的程序將更快、更簡單、更易于維護.

                  Remove threading completely, use an event loop to do the crawling. Your program will be faster, simpler, and easier to maintain.

                  大量等待網絡的線程不會讓您的程序等待得更快.相反,將所有打開的套接字收集到一個列表中并運行一個循環,檢查其中是否有任何可用的數據.

                  Lots of threads waiting for network won't make your program wait faster. Instead, collect all open sockets in a list and run a loop where you check if any of them has data available.

                  我推薦使用 Twisted - 它是一個事件驅動的網絡引擎.它非常靈活、安全、可擴展且非常穩定(無段錯誤).

                  I recommend using Twisted - It is an event-driven networking engine. It is very flexile, secure, scalable and very stable (no segfaults).

                  你也可以看看 Scrapy - 它是一個用 Python/Twisted 編寫的網絡爬取和屏幕抓取框架.它仍在大力開發中,但也許您可以提出一些想法.

                  You could also take a look at Scrapy - It is a web crawling and screen scraping framework written in Python/Twisted. It is still under heavy development, but maybe you can take some ideas.

                  這篇關于Python 線程 stack_size 和 segfaults的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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時顯示進度條?)

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

                        <tbody id='FmySq'></tbody>
                      <tfoot id='FmySq'></tfoot>

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

                          1. 主站蜘蛛池模板: 国产精品亚洲综合 | 伊人网91 | 亚洲精品国产第一综合99久久 | 日韩中文一区二区三区 | 欧美一区二区三区久久精品视 | 久久极品 | 老司机午夜性大片 | 一区二区三区在线免费观看 | 综合亚洲视频 | 色站综合 | 国产成人网 | 日本一区二区三区在线观看 | 亚洲v日韩v综合v精品v | 国产精品一区久久久久 | a级毛片国产 | 国产亚洲一区二区在线观看 | 久久久人成影片免费观看 | 亚洲国产视频一区二区 | 欧美日韩91 | 亚洲国产精品一区 | 日韩精品免费播放 | 特级一级黄色片 | 亚洲精品成人在线 | 日韩久久久久久 | 亚洲欧洲视频 | 国产精品中文在线 | 国产日韩久久久久69影院 | 日韩在线免费视频 | 亚洲视频在线免费观看 | 国产视频中文字幕 | 亚洲午夜小视频 | 国产一区二区三区在线免费 | 欧美三级视频在线观看 | 亚洲在线成人 | 韩国久久精品 | 在线播放国产一区二区三区 | 欧美专区在线 | 在线免费黄色 | 一区二区三区四区电影视频在线观看 | 久草在线在线精品观看 | 成人国产精品入口免费视频 |