<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-207286" style><p style="margin:1.2em 0px!important">Hi Frank,</p>
<p style="margin:1.2em 0px!important">If you need to run a number of tasks, limit the amount that are running concurrently, and would like to use Qt’s event system, then I think <a href="http://seanfisk.github.io/pyside-docs/pyside/PySide/QtCore/QThreadPool.html"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">QThreadPool</code></a> with <a href="http://seanfisk.github.io/pyside-docs/pyside/PySide/QtCore/QThreadPool.html#PySide.QtCore.PySide.QtCore.QThreadPool.setMaxThreadCount"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline">setMaxThreadCount()</code></a> is your best option.</p>


<p style="margin:1.2em 0px!important">Sincerely,</p>
</div><div></div></div><div class="gmail_extra"><br clear="all"><div><div><br></div><div>--</div><div>Sean Fisk</div></div>
<br><br><div class="gmail_quote">On Mon, Dec 16, 2013 at 2:32 PM, Frank Rueter | OHUfx <span dir="ltr"><<a href="mailto:frank@ohufx.com" target="_blank">frank@ohufx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Thanks Mat,<br>
will wait() block concurrent threads?<br>
In my case my app will receive an arbitrary amount of tasks and I need<br>
to figure out how many of those tasks I want to run at the same time.<br>
At the moment I am  using a simple threading.Thread ad<br>
threading.BoundedSemaphore combo to sensibly limit the amount of<br>
concurrent tasks (could be hundreds), and queue outstanding ones.<br>
I would however like to switch to QThread as I have a feeling QT's<br>
threading its more elegant than python's?!<br>
<br>
Cheers,<br>
frank<br>
<div class="im HOEnZb"><br>
<br>
<br>
On 17/12/13 06:36, Matthew Woehlke wrote:<br>
> On 2013-12-16 02:01, Frank Rueter | OHUfx wrote:<br>
>> I am playing with simple QThread object and am getting the ol' "QThread:<br>
>> Destroyed while thread is still running" error.<br>
> I would encourage you to always call wait() on your thread before it is<br>
> destroyed.<br>
><br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
PySide mailing list<br>
<a href="mailto:PySide@qt-project.org">PySide@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/pyside" target="_blank">http://lists.qt-project.org/mailman/listinfo/pyside</a><br>
</div></div></blockquote></div><br></div>