Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QThread on vxWorks

QThread on vxWorks

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 4 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Narasimman
    wrote on last edited by
    #1

    Below are the code sample

    #include <vxWorks.h>
    #include <QThread>
    #include <QDebug>

    class MyThread: public QThread
    {
    Q_OBJECT
    public:
    MyThread();
    ~MyThread();
    void Run();
    private:

    };

    MyThread::MyThread()
    {

    qDebug()<<"constructor";
    start();
    

    }
    MyThread::~MyThread()
    {
    qDebug()<<"destructor";

    terminate();
    

    }

    void MyThread::Run()
    {
    qDebug()<<"run";
    int nBytesReceived = 0;
    while(1)
    {
    //some business logic
    }
    }

    The above code is working fine on windows. All debug logs appears
    But the same code not working on vxwork with QT.
    executing successfully, only getting logs related to constructor, not getting the log of run. Seems Qthread not starting the thread, How to identify and fix the issues on this.

    jsulmJ 1 Reply Last reply
    0
    • N Narasimman

      Below are the code sample

      #include <vxWorks.h>
      #include <QThread>
      #include <QDebug>

      class MyThread: public QThread
      {
      Q_OBJECT
      public:
      MyThread();
      ~MyThread();
      void Run();
      private:

      };

      MyThread::MyThread()
      {

      qDebug()<<"constructor";
      start();
      

      }
      MyThread::~MyThread()
      {
      qDebug()<<"destructor";

      terminate();
      

      }

      void MyThread::Run()
      {
      qDebug()<<"run";
      int nBytesReceived = 0;
      while(1)
      {
      //some business logic
      }
      }

      The above code is working fine on windows. All debug logs appears
      But the same code not working on vxwork with QT.
      executing successfully, only getting logs related to constructor, not getting the log of run. Seems Qthread not starting the thread, How to identify and fix the issues on this.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Narasimman Why do you call start() in the constructor?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • N Offline
        N Offline
        Narasimman
        wrote on last edited by
        #3

        Start will execute the Run, We need this as soon object is declared.

        jsulmJ 1 Reply Last reply
        0
        • N Narasimman

          Start will execute the Run, We need this as soon object is declared.

          jsulmJ Online
          jsulmJ Online
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Narasimman I know what start() does. I'm not sure it is a good idea to call start() in the constructor while the object is still being constructed.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • N Offline
            N Offline
            Narasimman
            wrote on last edited by
            #5

            Yes, But is perfectly working on windows. So we used the same code.

            1 Reply Last reply
            0
            • N Offline
              N Offline
              Narasimman
              wrote on last edited by
              #6

              Any update on this?

              JKSHJ 1 Reply Last reply
              0
              • N Narasimman

                Any update on this?

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                Hi @Narasimman, I suspect that very few people on this forum (if any) have access to a vxWorks machine.

                Subscribe to the Interest mailing list and post your question there. Qt engineers are active on that list.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                2
                • kkoehneK Offline
                  kkoehneK Offline
                  kkoehne
                  Moderators
                  wrote on last edited by
                  #8

                  Even better would be to ask Qt Support. If you use Qt for VxWorks you're a paying customer, after all :)

                  Director R&D, The Qt Company

                  1 Reply Last reply
                  3

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved