跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

What is the difference between dly_tsk and tslp_tsk?

Latest Updated:06/12/2015

Question:

What is the difference between dly_tsk and tslp_tsk?

Answer:

Both of them are service-calls which make the execution of a task wait for a set amount of time. They differ in the following way.
•    tslp_tsk(TMO tmout)
If a task is not reawakened by wup_tsk during tmout, it is released from waiting and the E_TMOUT error code is returned.
•    dly_tsk(RELTIM dlytim)
The given task is placed in the waiting state over dlytim. It is not released from the waiting state even if wup_tsk is called.

That is, in the case of tslp_tsk, E_OK (normal end) is returned when another task releases the given task from waiting, but E_TMOUT (time out error) is returned when tmout has elapsed. On the other hand, in the case of dly_tsk, other tasks do not return the given task from waiting (except for forcibly releasing it from waiting), and E_OK (normal end) is returned when dly_tsk has elapsed. Use dly_tsk for intentionally postponing processes.

 

Suitable Products
RI850V4 V2 Real-time OS for RH850 Family
RI850V4 V1 Real-time OS for V850 Family
RI850MP Real-time OS for V850E2M Dual Core
RI600V4 Real-time OS for RX Family
RI600PX Real-time OS for RX Family
RI78V4 V2 Real-time OS for RL78 Family
RI78V4 V1 Real-time OS for RL78 Family and 78K0R