1
  1. Does somebody know how to minimize memory usage of QRunnable ? What are the pitfalls in using QRunnable and QThreadPool. I have simple application crawling urls and memory usage is astonishing. It looks like QRunnable objects aren't deleted after execution.

  2. Is there any rational way for doing multithreading in PyQT where you have list of urls to crawl and you want to crawl for example 10 urls at once using threads ? I know how to do it in threading (producer/consumer) but threading doesn't work. QRunnable is so much buggy!

Bach
  • 6,145
  • 7
  • 36
  • 61
Nuncjo
  • 1,290
  • 3
  • 15
  • 16
  • Is this question still relevant now that you have an answer to http://stackoverflow.com/questions/21971832/python-pyqt-pyside-qthread-limiting? – Oliver Feb 24 '14 at 16:05
  • I must test this for a while to find out if this is the best solution but i can tell that this is better than QRunnable. Thanks. – Nuncjo Feb 24 '14 at 21:58

1 Answers1

0

Is there any rational way for doing multithreading in PyQT where you have list of urls to crawl and you want to crawl for example 10 urls at once using threads ?

You can use 10 instances of QWebView in single thread for example. QT is asynchronous and all instances will do there tasks parallelly. See this example. Note, that each QWebView instance eat some memory. If you don't need javascript, just plain HTTP requests, you can use QTextBrowser same way.

Community
  • 1
  • 1
Mikhail Gerasimov
  • 36,989
  • 16
  • 116
  • 159