Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28947

QStateMachine: heigh load for waiting on events only

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 4.8.4, 5.0.0
    • Fix Version/s: None
    • Component/s: Core: State Machine
    • Labels:
      None

      Description

      The code below does nothing than waiting for events but "eats" one processor core.

      QStateMachine machine;
      
      QState* parallel = new QState(QState::ParallelStates, &machine);
      machine.setInitialState(parallel);
      
      for (int i = 0; i < 10 * 1000; i++) {
          QState* group = new QState(parallel);
          QState* s1 = new QState(group);
          group->setInitialState(s1);
      }
      
      QEventLoop loop;
      connect(&machine, SIGNAL(finished()), &loop, SLOT(quit()));
      
      machine.start();
      loop.exec();
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            syntheticpp Peter K├╝mmel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes