Home > other >  How do you determine the real-time operating system within the deadline to complete the task by your
How do you determine the real-time operating system within the deadline to complete the task by your

Time:09-26


As is known to all, RTOS and the difference between other OS:
The task of () the latest finish time (Deadline) can be determined to predict,


But has not clear is how to implement this mechanism,
Hope to have a great god solve,

CodePudding user response:

I think what you say is not accurate, can't say the task completion time, can only say that task switching time can be sure of, in a multitasking environment, task starts, is generally only blocking and operation, completed the task not quit, multitasking environment, hard real-time operating system can ensure the highest priority task in the expected time for CPU control, but if the software itself design is unreasonable, so it is not possible to perform,
For example:
Time slice to 10 ms, it only took 2 priority, high and low priority each have five tasks, high-priority can preempt the low priority, rotation between equal priority, if each high-priority task did not hand over the CPU time (for example, invoke a sleep or blocked waiting for a semaphore functions like), so the five high-priority will each use 10 ms run once in turn, the second time, then run... , low priority can not get chance to run forever, in this case, the concept of unfinished only switching time is certain,

Can determine typically refers to, such as a hardware interrupt occurs, from any one task or low cut to the higher priority interrupt priority interrupt time can be determined, so it can guarantee the real time response, so the system design is the key!

CodePudding user response:

reference 1st floor wfy1008 response:
I think what you say is not accurate, can't say the task completion time, can only say that task switching time can be sure of, in a multitasking environment, task starts, is generally only block and run, not completed the task withdrew, multitasking environment, hard real-time operating system can ensure the highest priority task in the expected time for CPU control, but if the software itself design is unreasonable, so it is not possible to perform,
For example:
Time slice to 10 ms, it only took 2 priority, high and low priority each have five tasks, high-priority can preempt the low priority, rotation between equal priority, if each high-priority task did not hand over the CPU time (for example, invoke a sleep or blocked waiting for a semaphore functions like), so the five high-priority will each use 10 ms run once in turn, the second time, then run... , low priority can not get chance to run forever, in this case, the concept of unfinished only switching time is certain,

Can determine typically refers to, such as a hardware interrupt occurs, from any one task or low cut to the higher priority interrupt priority interrupt time can be determined, so it can guarantee the real time response, so the system design is the key!
wow, thanks, have some understanding??????

CodePudding user response:

I read rtthread source, rt each thread will record a tick tick this unit is a system of the heart, this heart is commonly a hardware timer interrupt (typically set to 10 ms), each time will raise the interrupt + 1 and start the scheduler, the scheduler will determine whether the thread arrived in you to set the maximum time, if reached the timeout, the scheduler will be looking for higher priority and is ready to state the thread, and run it,
  • Related