I found an interesting benchmark of 6 RTOSes including rt-thread:
[Timing Comparison of the Real-Time Operating
Systems for Small Microcontrollers](https://www.mdpi.com/2073-8994/12/4/592). Rt-thread is doing pretty well!
Below is benchmark code used in rt-thread:
void Task1 (void *argument)
{
rt_uint32_t e;
while (1)
{
#if (RTOS_TEST == TEST1)
rt_mb_recv(mailboxTest, &e, RT_WAITING_FOREVER);
PIN_On(0);
#elif (RTOS_TEST == TEST2)
rt_thread_delay(1);//wait 1ms
PIN_Off(0);
rt_mb_recv(mailboxTest, &e, 1u);
PIN_Off(0);
#elif (RTOS_TEST == TEST3)
rt_mb_send(mailboxTest,0);
rt_thread_delay(1);//wait 1ms
PIN_Off(0);
rt_mb_recv(mailboxTest, &e, RT_WAITING_FOREVER);
PIN_On(0);
#elif (RTOS_TEST == TEST4)
rt_thread_delay(1);//wait 1ms
PIN_Off(0);
rt_mb_send(mailboxTest,0);
PIN_On(0);
rt_mb_recv(mailboxTest, &e, RT_WAITING_FOREVER);
#else
osDelay(1);
#endif
}
}
void Task2 (void *argument)
{
while (1)
{
#if (RTOS_TEST == TEST1)
rt_thread_delay(1);//wait 1ms
PIN_Off(0);
rt_mb_send(mailboxTest,0);
#elif (RTOS_TEST == TEST2)
PIN_On(0);
#elif (RTOS_TEST == TEST3)
rt_thread_delay(1);//wait 1ms
#elif (RTOS_TEST == TEST4)
rt_thread_delay(1);//wait 1ms
#else
rt_thread_delay(1);//wait 1ms
#endif
}
}
The link has changed to https://www.mdpi.com/685498