Opened 15 years ago

Closed 15 years ago

#1659 closed patch (fixed)

replace not working pthread_setschedparam for SCHED_OTHER with setpriority

Reported by: ajlill@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no


Using pthread_setschedparam() to "nice" the scheduler thread does nothing. This patch changes it to use setpriority()

Attachments (2)

schedprio.patch (814 bytes) - added by ajlill@… 15 years ago.
thread_priority_setting.diff (3.4 KB) - added by Janne <janne-mythtv@…> 15 years ago.

Download all attachments as: .zip

Change History (5)

Changed 15 years ago by ajlill@…

Attachment: schedprio.patch added

comment:1 Changed 15 years ago by malcolm-mythtv@…

There's also an occurrence in libmythtv/previewgenerator.cpp and libmythtv/eitscanner.cpp, neither of which will achieve anything.

For some reason, Linux returns EINVAL on any attempt to set a non-zero priority for SCHED_OTHER pthreads, although setpriority() within the thread works fine.

comment:2 Changed 15 years ago by Janne <janne-mythtv@…>

Summary: the attempt to nice the scheduler thread doesn't workreplace not working pthread_setschedparam for SCHED_OTHER with setpriority
Type: defectpatch
Version: head

The only supported priority for policy SCHED_OTHER is 0. And for every other sched_param pthread_setschedparam fails with EINVAL for me. setpriority() seems to work as intended.

Attached patch converts also the other occurances of pthread_setschedparam with SCHED_OTHER to setpriority().

This might solve the playback issues some people see with EIT processing.

Changed 15 years ago by Janne <janne-mythtv@…>

comment:3 Changed 15 years ago by Stuart Auchterlonie

Resolution: fixed
Status: newclosed

(In [10636]) Closes #1659. Fixes priority settings of various threads

Replaces the not working pthread_setschedparam with setpriority (SCHED_OTHER).

Note: See TracTickets for help on using tickets.