<?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[why my first thread not  run and 2nd thread run continuously ?]]></title><description><![CDATA[<p dir="auto">i have written below code to run 2 thread simultaneously. but i get my first thread not get opportunity run and 2nd thread run continuously.</p>
<pre><code>#include "dialog.h"
#include "ui_dialog.h"
#include &lt;QDateTime&gt;
#include &lt;QDebug&gt;


Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui-&gt;setupUi(this);

    StartThread();
    qDebug() &lt;&lt; "End of Program";
}

void Dialog:: StartThread()
{
    HelloThread_1 thread1;
    HelloThread_2 thread2;

    thread1.start();
    qDebug() &lt;&lt; "hello from GUI thread " &lt;&lt; thread1.currentThreadId();


    thread2.start();
    qDebug() &lt;&lt; "hello from GUI thread " &lt;&lt; thread2.currentThreadId();
    thread1.wait();  // do not exit before the thread is completed!
    thread2.wait();  // do not exit before the thread is completed!


}


void HelloThread_1::run()
{
    while(1)
    {
        qDebug() &lt;&lt; "hello from worker thread AAAA";

        FuelCheck ObjFuelCheck;
        ObjFuelCheck.gauge_init();

        int Percentage = -1;
        bool bisFuelConnected = true;

        ObjFuelCheck.gauge_cmd_read(ObjFuelCheck.nI2CId, 0x2c);

        Percentage = ObjFuelCheck.u16Datareceived;

        qDebug()&lt;&lt; "percentage :"&lt;&lt;Percentage;
        QThread::msleep(100);
        if((Percentage &lt; 0) &amp;&amp; (Percentage &gt; 100))
        {
            bisFuelConnected = false;

            qDebug() &lt;&lt; "Fuel gauge found but wrong percentarge detected : " + QString::number(Percentage);
        }


        FuelGaugeProfileUpdate *pFuelGaugeProfileUpdate = new FuelGaugeProfileUpdate();
        if(IS_VALID_OBJ(pFuelGaugeProfileUpdate))
        {
           pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile =true;
            if(pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile)
            {
                pFuelGaugeProfileUpdate-&gt;show();
            }
            else
            {
                DELETE_OBJ(pFuelGaugeProfileUpdate);
            }
        }

        NfcTagReaderWriter *objNFCTag_write = new NfcTagReaderWriter();

        if(IS_VALID_OBJ(objNFCTag_write))
        {
            if(objNFCTag_write-&gt;NFCInit())
            {
                if(objNFCTag_write-&gt;ReadNdefTextMessage() == 0x00)
                {
                    qDebug()&lt;&lt;"WriteNdefTextMessage";
                    objNFCTag_write-&gt;WriteNdefTextMessage();
                }
            }
            DELETE_OBJ(objNFCTag_write);
        }


            QThread::msleep(1000);


    }
}


void HelloThread_2::run()
{
      while(1)
      {
           qDebug() &lt;&lt; "hello from worker thread BBBB";

           bool bIsVinVolt = false;
           float fVinVolt = 0.0;
           uint16_t u16AdcValue = 0;
           ExtAdc  ObjExtAdc;
           ObjExtAdc.GetAvgValue(ADC_BATTERYLEVEL);
           AdcSettings AdcInfo;
               u16AdcValue = AdcInfo.u16AdcAverageValue[ADC_BATTERYLEVEL];
               qDebug()&lt;&lt;"u16AdcValue "&lt;&lt;u16AdcValue;

               if(u16AdcValue &lt; 11500)
               {
                   bIsVinVolt =false;
                   //TableInsertData(sBattery(), sLow()); // + " " + QString::number(u16AdcValue));


               }
               else
               {
                   bIsVinVolt =true;
                   //TableInsertData(sBattery() , sOk()); // + QString::number(u16AdcValue));

               }


              QThread::msleep(1000);

      }
}

Dialog::~Dialog()
{
    delete ui;
}

---------------------------------

</code></pre>
<p dir="auto"><strong>my code output is :</strong><br />
hello from GUI thread  0x76fb8660<br />
hello from GUI thread  0x76fb8660<br />
hello from worker thread AAAA<br />
hello from worker thread BBBB<br />
percentage : 23</p>
<blockquote>
<p dir="auto">L&gt;u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
hello from worker thread BBBB<br />
u16AdcValue  0<br />
.<br />
.<br />
.</p>
</blockquote>
]]></description><link>https://forum.qt.io/topic/127830/why-my-first-thread-not-run-and-2nd-thread-run-continuously</link><generator>RSS for Node</generator><lastBuildDate>Thu, 25 Jun 2026 19:38:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/127830.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 22 Jun 2021 13:23:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Tue, 22 Jun 2021 18:30:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Does any of the functions you call in your HelloThread_1 block ?</p>
<p dir="auto">Not that it's not a good idea to have an infinite loop without a break condition to cleanly stop the thread.</p>
]]></description><link>https://forum.qt.io/post/666706</link><guid isPermaLink="true">https://forum.qt.io/post/666706</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 22 Jun 2021 18:30:13 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 12:52:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> Then it should work as long as no errors happen with isInterruptionRequested if you use it correctly. But from your code I do not see where you actually request the thread to stop (you just wait for the threads)? If you do not ask it to stop why should it stop?!<br />
If you read <a href="https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested</a> you will find link to <a href="https://doc.qt.io/qt-5/qthread.html#requestInterruption" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qthread.html#requestInterruption</a> which you can use to ask the thread to stop.</p>
]]></description><link>https://forum.qt.io/post/666874</link><guid isPermaLink="true">https://forum.qt.io/post/666874</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 12:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 12:48:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> 30 to 50 second and infinite when some error happen while i2c write</p>
]]></description><link>https://forum.qt.io/post/666873</link><guid isPermaLink="true">https://forum.qt.io/post/666873</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 12:48:16 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 12:35:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> said in <a href="/post/666870">why my first thread not run and 2nd thread run continuously ?</a>:</p>
<blockquote>
<p dir="auto">am i correct ?</p>
</blockquote>
<p dir="auto">No, you are wrong. You just have to make sure you don't open too many files at once.</p>
<p dir="auto">I ask now for the third (and last) time: for how long does your blocking function block?</p>
]]></description><link>https://forum.qt.io/post/666871</link><guid isPermaLink="true">https://forum.qt.io/post/666871</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 12:35:13 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 12:29:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> means i need to open file out side thread.</p>
<p dir="auto">not inside thread.</p>
<p dir="auto">am i correct ?</p>
]]></description><link>https://forum.qt.io/post/666870</link><guid isPermaLink="true">https://forum.qt.io/post/666870</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 12:29:41 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 11:29:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a><br />
Linux errno 24 (<code>EMFILE</code>) is too many open files <em>for your process</em> (or maybe your user, but <em>not</em> I think for the system).  I think you can alter this via <code>ulimit</code>, or others.  But obviously you need to understand where you are keeping open file handles from.</p>
]]></description><link>https://forum.qt.io/post/666859</link><guid isPermaLink="true">https://forum.qt.io/post/666859</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 23 Jun 2021 11:29:09 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 10:54:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a>  i have found that there i am getting error due to<br />
"  Errno 24 : Too many open files" on /dev/i2c-2"</p>
]]></description><link>https://forum.qt.io/post/666856</link><guid isPermaLink="true">https://forum.qt.io/post/666856</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 10:54:27 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:58:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> Just for your information all devices connected to same i2c bus</p>
]]></description><link>https://forum.qt.io/post/666850</link><guid isPermaLink="true">https://forum.qt.io/post/666850</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:58:29 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:55:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a></p>
<p dir="auto">thread 1 execute for only one time then it get block. while thread 2 run continuously</p>
<pre><code>#include "dialog.h"
#include "ui_dialog.h"
#include &lt;QDateTime&gt;
#include &lt;QDebug&gt;

#include &lt;QFile&gt;
#include &lt;QTextStream&gt;

Dialog::Dialog(QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::Dialog)
{
    ui-&gt;setupUi(this);

    StartThread();
    qDebug() &lt;&lt; "End of Program";
}

void Dialog:: StartThread()
{
    HelloThread_1 thread1;
    HelloThread_2 thread2;

    thread1.start();
    qDebug() &lt;&lt; "hello from GUI thread " &lt;&lt; thread1.currentThreadId();


    thread2.start();
    qDebug() &lt;&lt; "hello from GUI thread " &lt;&lt; thread2.currentThreadId();
    thread1.wait();  // do not exit before the thread is completed!
    thread2.wait();  // do not exit before the thread is completed!


}


void HelloThread_1::run()
{
    while(1)
    {
        if(QThread::currentThread()-&gt;isInterruptionRequested())
            return;

        qDebug() &lt;&lt; "hello from worker thread AAAA";

        FuelCheck ObjFuelCheck;
        
        ObjFuelCheck.gauge_init();
       
        int Percentage = -1;
        bool bisFuelConnected = true;

        ObjFuelCheck.gauge_cmd_read(ObjFuelCheck.nI2CId, 0x2c);
qDebug() &lt;&lt; __LINE__;
        Percentage = ObjFuelCheck.u16Datareceived;

        qDebug()&lt;&lt; "percentage :"&lt;&lt;Percentage;

        QFile data("/home/user/output.txt");
        if (data.open(QFile::WriteOnly | QFile::Append | QFile::Text)) {
            QTextStream out(&amp;data);
            out &lt;&lt; "Result: "&lt;&lt; QDateTime::currentDateTime().toString("dd MMM yyyy HH:mm:ss") &lt;&lt; " "&lt;&lt; "percentage :"&lt;&lt;Percentage&lt;&lt;"\n";
            // writes "Result: 3.14      2.7       "
        }

        QThread::msleep(100);
        if((Percentage &lt; 0) &amp;&amp; (Percentage &gt; 100))
        {
            bisFuelConnected = false;

            qDebug() &lt;&lt; "Fuel gauge found but wrong percentarge detected : " + QString::number(Percentage);
        }

        **// below  part block function **
        FuelGaugeProfileUpdate *pFuelGaugeProfileUpdate = new FuelGaugeProfileUpdate();

        if(IS_VALID_OBJ(pFuelGaugeProfileUpdate))
        {
           pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile =true;
          
            if(pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile)
            {

                pFuelGaugeProfileUpdate-&gt;show();
            }
            else
            {
               DELETE_OBJ(pFuelGaugeProfileUpdate);
            }

        }
        //------------------------------------------------
       NfcTagReaderWriter *objNFCTag_write = new NfcTagReaderWriter();

        if(IS_VALID_OBJ(objNFCTag_write))
        {
            if(objNFCTag_write-&gt;NFCInit())
            {
                if(objNFCTag_write-&gt;ReadNdefTextMessage() == 0x00)
                {
                    qDebug()&lt;&lt;"WriteNdefTextMessage";

                    QFile data("/home/user/output.txt");
                    if (data.open(QFile::WriteOnly | QFile::Append | QFile::Text)) {
                        QTextStream out(&amp;data);
                        out &lt;&lt; "Result: "&lt;&lt; QDateTime::currentDateTime().toString("dd MMM yyyy HH:mm:ss") &lt;&lt; " "&lt;&lt; "objNFCTag_write-&gt;Text.text :"&lt;&lt;objNFCTag_write-&gt;Text.text&lt;&lt;"\n";
                        // writes "Result: 3.14      2.7       "
                    }
                    //objNFCTag_write-&gt;WriteNdefTextMessage();

                }
            }
            qDebug() &lt;&lt; __LINE__;
            DELETE_OBJ(objNFCTag_write);
        }

qDebug() &lt;&lt; __LINE__;
            QThread::msleep(1000);


    }
}


void HelloThread_2::run()
{
      while(1)
      {
          if(QThread::currentThread()-&gt;isInterruptionRequested())
              return;
           qDebug() &lt;&lt; "hello from worker thread BBBB";

           ExtAdc  ObjExtAdc;
           AdcSettings AdcInfo;
           uint8_t u8ReadADC_no = 2;
           ObjExtAdc.AdcReadFile((ADC_type)(u8ReadADC_no));

           QString sADC_value = QString::number(ObjExtAdc.i32AdcReadValue);
           QFile data("/home/user/output.txt");
           if (data.open(QFile::WriteOnly | QFile::Append | QFile::Text)) {
               QTextStream out(&amp;data);
               out &lt;&lt; "Result: "&lt;&lt; QDateTime::currentDateTime().toString("dd MMM yyyy HH:mm:ss") &lt;&lt; " "&lt;&lt; "u16AdcValue "&lt;&lt;sADC_value&lt;&lt;"\n";
               // writes "Result: 3.14      2.7       "
           }
           qDebug()&lt;&lt;"u16AdcValue "&lt;&lt;sADC_value;

           /*
           uint16_t u16AdcValue = 0;
           bool bIsVinVolt = false;
           float fVinVolt = 0.0;


           ObjExtAdc.GetAvgValue(ADC_BATTERYLEVEL);
           if(AdcInfo.bAdcReadError == true)
           {
            qDebug()&lt;&lt;"adc read error";
           }
           else
           {
               u16AdcValue = AdcInfo.u16AdcAverageValue[ADC_BATTERYLEVEL];

               QFile data("/home/user/output.txt");
               if (data.open(QFile::WriteOnly | QFile::Append | QFile::Text)) {
                   QTextStream out(&amp;data);
                   out &lt;&lt; "Result: "&lt;&lt; QDateTime::currentDateTime().toString("dd MMM yyyy HH:mm:ss") &lt;&lt; " "&lt;&lt; "u16AdcValue "&lt;&lt;u16AdcValue&lt;&lt;"\n";
                   // writes "Result: 3.14      2.7       "
               }
               qDebug()&lt;&lt;"u16AdcValue "&lt;&lt;u16AdcValue;

               if(u16AdcValue &lt; 11500)
               {
                   bIsVinVolt =false;
                   //TableInsertData(sBattery(), sLow()); // + " " + QString::number(u16AdcValue));


               }
               else
               {
                   bIsVinVolt =true;
                   //TableInsertData(sBattery() , sOk()); // + QString::number(u16AdcValue));

               }
           }
*/

              QThread::msleep(1000);

      }
}

Dialog::~Dialog()
{
    delete ui;
}


</code></pre>
]]></description><link>https://forum.qt.io/post/666849</link><guid isPermaLink="true">https://forum.qt.io/post/666849</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:55:11 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:46:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> Please show the code.<br />
Also, I asked before for how long the blocking function is actually blocking?</p>
]]></description><link>https://forum.qt.io/post/666847</link><guid isPermaLink="true">https://forum.qt.io/post/666847</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:46:03 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:44:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a>  i have tried it but still i got same output. i have commented blocking function call it works. but continuous running thread stop  /dev/i2c-2 to get open.</p>
<p dir="auto">this is the main problem. and 2nd problem  without comment my blocking function how to make this code get work simultaneously</p>
]]></description><link>https://forum.qt.io/post/666844</link><guid isPermaLink="true">https://forum.qt.io/post/666844</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:44:01 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:23:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> Let's go one step back, you asked: "So what i need to change in above code to cleanly stop thread ?". I pointed you to <a href="https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested</a> - did you try it? If so, what is the problem now?</p>
]]></description><link>https://forum.qt.io/post/666842</link><guid isPermaLink="true">https://forum.qt.io/post/666842</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:23:59 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:19:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> while 2 thread running .it block until i close application.  you can see output i written below code.</p>
<p dir="auto">can you elaborate your question more i am not understand your below question :<br />
Does that function provide a way to interrupt it?</p>
]]></description><link>https://forum.qt.io/post/666840</link><guid isPermaLink="true">https://forum.qt.io/post/666840</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:19:53 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:13:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> Do you mean in your thread? For how long does it block? Does that function provide a way to interrupt it?</p>
]]></description><link>https://forum.qt.io/post/666839</link><guid isPermaLink="true">https://forum.qt.io/post/666839</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:13:19 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 09:11:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jsulm">@<bdi>jsulm</bdi></a> what i need to do when  blocking function occur during multi threading ?</p>
]]></description><link>https://forum.qt.io/post/666838</link><guid isPermaLink="true">https://forum.qt.io/post/666838</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 09:11:27 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 05:22:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/qt-embedded-developer">@<bdi>Qt-embedded-developer</bdi></a> said in <a href="/post/666758">why my first thread not run and 2nd thread run continuously ?</a>:</p>
<blockquote>
<p dir="auto">So what i need to change in above code to cleanly stop thread ?</p>
</blockquote>
<p dir="auto"><a href="https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-5/qthread.html#isInterruptionRequested</a></p>
]]></description><link>https://forum.qt.io/post/666759</link><guid isPermaLink="true">https://forum.qt.io/post/666759</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 23 Jun 2021 05:22:20 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 05:19:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> said in <a href="/post/666706">why my first thread not run and 2nd thread run continuously ?</a>:</p>
<blockquote>
<p dir="auto">cleanly stop the thread.</p>
</blockquote>
<p dir="auto">So what i need to change in above code to cleanly stop thread ?</p>
]]></description><link>https://forum.qt.io/post/666758</link><guid isPermaLink="true">https://forum.qt.io/post/666758</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 05:19:25 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Wed, 23 Jun 2021 05:17:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> yes in thread 1 below part of code is blocking</p>
<p dir="auto">FuelGaugeProfileUpdate *pFuelGaugeProfileUpdate = new FuelGaugeProfileUpdate();<br />
if(IS_VALID_OBJ(pFuelGaugeProfileUpdate))<br />
{<br />
pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile =true;<br />
if(pFuelGaugeProfileUpdate-&gt;bIsRequiredToUpdateFuelGaugeProfile)<br />
{<br />
pFuelGaugeProfileUpdate-&gt;show();<br />
}<br />
else<br />
{<br />
DELETE_OBJ(pFuelGaugeProfileUpdate);<br />
}<br />
}</p>
]]></description><link>https://forum.qt.io/post/666755</link><guid isPermaLink="true">https://forum.qt.io/post/666755</guid><dc:creator><![CDATA[Qt embedded developer]]></dc:creator><pubDate>Wed, 23 Jun 2021 05:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to why my first thread not  run and 2nd thread run continuously ? on Tue, 22 Jun 2021 18:30:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Does any of the functions you call in your HelloThread_1 block ?</p>
<p dir="auto">Not that it's not a good idea to have an infinite loop without a break condition to cleanly stop the thread.</p>
]]></description><link>https://forum.qt.io/post/666706</link><guid isPermaLink="true">https://forum.qt.io/post/666706</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 22 Jun 2021 18:30:13 GMT</pubDate></item></channel></rss>