Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QThread CPU Problem
Forum Updated to NodeBB v4.3 + New Features

QThread CPU Problem

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 256 Views 1 Watching
  • 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.
  • jondoeJ Offline
    jondoeJ Offline
    jondoe
    wrote on last edited by jondoe
    #1

    Hello,
    I using QThread for 2 function but this qthreads using so much CPU. Where is the problem can u help me please ?

    NOT
    When i deleting while(1) in interfactothread1test.cpp CPU %0 working good but i need this function. What can i use instead of while(1) ?

    My codes here

    interfactothread1test.h
    https://pastebin.com/AGnFK8v7

    interfactothread1test.cpp
    https://pastebin.com/Edmdhtzy

    thread1test.h
    https://pastebin.com/YnR9KgiB

    thread1test.cpp
    https://pastebin.com/9Sz08q5n

    main.cpp
    https://pastebin.com/jg0M4n3e

    Thank you!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you want to quit the thread after 3 seconds, why not use a QTimer also why quit the process like that ? You can use QThread::quit method to simply stop the QThread that is running.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

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