<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[OpenMP and processEvents()]]></title><description><![CDATA[<p dir="auto">Hello,<br />
I'm facing a problem when trying to refresh GUI during a big computation.<br />
I have something like this<br />
@<br />
int main()<br />
{<br />
#pragma omp parallel for<br />
for( int i=0; i&lt;stop; i++ )<br />
heavyStuff(i);<br />
}</p>
<p dir="auto">void heavyStuff(int i)<br />
{<br />
for( int j=0; j&lt;maxJ;j++ )<br />
{<br />
// lengthy computation<br />
doSomething();</p>
<pre><code>     // would like to processEvents here, but we are in a thread!
    qApp-&gt;processEvents();
</code></pre>
<p dir="auto">}<br />
@</p>
]]></description><link>https://forum.qt.io/topic/42492/openmp-and-processevents</link><generator>RSS for Node</generator><lastBuildDate>Wed, 13 May 2026 06:44:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/42492.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 13 Jun 2014 07:23:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to OpenMP and processEvents() on Fri, 13 Jun 2014 12:21:10 GMT]]></title><description><![CDATA[<p dir="auto">[quote]void QCoreApplication::processEvents()</p>
<p dir="auto">Processes all pending events <em>for the calling thread</em> according to the specified flags until there are no more events to process.[/quote]</p>
<p dir="auto">So, yes. It should be "okay". But it only processes the pending events <em>for the calling thread</em>. You probably want to call this from the "main" thread - at least if your goal is to keep the UI "responsive" during a lengthy operation.</p>
]]></description><link>https://forum.qt.io/post/231836</link><guid isPermaLink="true">https://forum.qt.io/post/231836</guid><dc:creator><![CDATA[MuldeR]]></dc:creator><pubDate>Fri, 13 Jun 2014 12:21:10 GMT</pubDate></item><item><title><![CDATA[Reply to OpenMP and processEvents() on Fri, 13 Jun 2014 08:37:02 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for looking at my problem.<br />
Is that ok to call qApp-&gt;processEvents(); from any thread?</p>
]]></description><link>https://forum.qt.io/post/231820</link><guid isPermaLink="true">https://forum.qt.io/post/231820</guid><dc:creator><![CDATA[JulienMaille]]></dc:creator><pubDate>Fri, 13 Jun 2014 08:37:02 GMT</pubDate></item><item><title><![CDATA[Reply to OpenMP and processEvents() on Fri, 13 Jun 2014 07:29:31 GMT]]></title><description><![CDATA[<p dir="auto">Sorry but I haven't understand your problem ??  what problem r u facing ??</p>
]]></description><link>https://forum.qt.io/post/231812</link><guid isPermaLink="true">https://forum.qt.io/post/231812</guid><dc:creator><![CDATA[ankursaxena]]></dc:creator><pubDate>Fri, 13 Jun 2014 07:29:31 GMT</pubDate></item></channel></rss>