forked from Archive/PX4-Autopilot
Simulation: Set scheduling policy RR for lockstep
This should ensure that all processes do still run at full load.
This commit is contained in:
parent
663436fd47
commit
742b1839d5
|
@ -265,7 +265,12 @@ WorkQueueManagerRun(int, char **)
|
||||||
|
|
||||||
#ifndef __PX4_QURT
|
#ifndef __PX4_QURT
|
||||||
// schedule policy FIFO
|
// schedule policy FIFO
|
||||||
|
|
||||||
|
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||||
|
int ret_setschedpolicy = pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
||||||
|
#else
|
||||||
int ret_setschedpolicy = pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
|
int ret_setschedpolicy = pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret_setschedpolicy != 0) {
|
if (ret_setschedpolicy != 0) {
|
||||||
PX4_ERR("failed to set sched policy SCHED_FIFO (%i)", ret_setschedpolicy);
|
PX4_ERR("failed to set sched policy SCHED_FIFO (%i)", ret_setschedpolicy);
|
||||||
|
|
|
@ -204,7 +204,11 @@ px4_task_t px4_task_spawn_cmd(const char *name, int scheduler, int priority, int
|
||||||
return (rv < 0) ? rv : -rv;
|
return (rv < 0) ? rv : -rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||||
|
rv = pthread_attr_setschedpolicy(&attr, SCHED_RR);
|
||||||
|
#else
|
||||||
rv = pthread_attr_setschedpolicy(&attr, scheduler);
|
rv = pthread_attr_setschedpolicy(&attr, scheduler);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
PX4_ERR("px4_task_spawn_cmd: failed to set sched policy");
|
PX4_ERR("px4_task_spawn_cmd: failed to set sched policy");
|
||||||
|
|
Loading…
Reference in New Issue