How to control the time offset of two threads in Linux?

123 Views Asked by At

Is there any way to create two SCHED_DEADLINE threads with a specific offset (phase) to a global cycle? I am trying to create two threads, both with a period of 10 ms, but with an offset of 5ms between their arrival times. The behaviour should look like this, with | being the arrival time, x the actual start time and D being the absolute deadline. Both threads are independent, so there is no need to synchronize them using mutexes etc. They just need the time offset.

Thread 1 |-----xooooo---------D-------------|

Thread 2 ------------------|-----xoooo--D-----

1

There are 1 best solutions below

0
On

Maybe you can use timer_create() with timer_settime().