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

QThread::setPriority fails with SCHED_RESET_ON_FORK

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.12.8
    • Core: Threads
    • None
    • Ubuntu Focal
    • Linux/X11

    Description

      In case of Pipewire the scheduler policy is "SCHED_RESET_ON_FORK | SCHED_FIFO"

      In this case QThread::setPriority() fails with

      "QThread::setPriority: Cannot determine scheduler priority range"

      this is because the sub-call "sched_get_priority_max()" returns -1 with SCHED_RESET_ON_FORK set.

      Without the flag everything works flawlessly.

      This has been tested on Ubuntu Focal and Qt 5.12.8 but the code is still the same in the "dev" branch so I assume that more recent versions are also affected.

      https://github.com/qt/qtbase/blob/7191b8fe38788ac57e15e4124955c3cd8333d858/src/corelib/thread/qthread_unix.cpp#L819

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            daschuer Daniel Schürmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes