<div class="gmail_quote">On Fri Nov 28 2014 at 2:07:32 AM Michael Torrie <<a href="mailto:torriem@gmail.com">torriem@gmail.com</a>> wrote:<br> Okay, here's a reworking of the code that invokes a new QThread instance<br> each time.  Note the QThread instance has to be bound to the MainWindow<br> so that it won't be destroyed when it goes out of scope.  Also the<br> Worker thread sends a signal with the data, so there's no need to check<br> worker.trades and risk it being invalid data.<br> <br> Perhaps this would be more what you had in mind.<br> <br> You may want to look into asynchronous I/O as well.  That does not<br> require threads at all.  Fire off a request to load a url, and then get<br> a callback when it's done.<div><br></div><div><br></div><div>Now it's working like a charm without any freezes. I'll reproduce this 'Worker' for other stuffs that I need to call the web, but first I have a question.</div><div><br></div><div>Which one would be better in performance, having a single 'Worker' to call all URLs, having inside this worker functions for each stuff, or having 3~5 different workers doing different stuff. In the end I'll only print the data when I have them all.</div><div><br></div><div>The problem is that I would have a long new_value = Signal(QThread, str, str), with more then 10 values, is it possible to pass objects here like new_value = Signal(QThread, ObjA, ObjB, ...) so that in the 'create_topic' I would get the objects and call methods in order to get all the data?</div><div><br></div><div>This approach would be better, because I may be adding more stuff and I wouldn't need to add tons and tons of new stuff in my signal, only one object.</div><div><br></div><div>You don't need to redo the code, I just need to know if it's a 'good approach' and if it's possible, from here I can work my way.</div></div>