FreeRTOS之Tasks和Co-routines的区别
Co-routines使用在对RAM资源少的场合
Task Summary
![]() |
Simple. |
![]() |
No restrictions on use. |
![]() |
Supports full preemption. |
![]() |
Fully prioritised. |
![]() |
Each task maintains its own stack resulting in higher RAM usage. |
![]() |
Re-entrancy must be carefully considered if using preemption. |
Co-Routine Summary
![]() |
Sharing a stack between co-routines results in much lower RAM usage. |
![]() |
Cooperative operation makes re-entrancy less of an issue. |
![]() |
Very portable across architectures. |
![]() |
Fully prioritised relative to other co-routines, but can always be preempted by tasks if the two are mixed. |
![]() |
Lack of stack requires special consideration. |
![]() |
Restrictions on where API calls can be made. |
![]() |
Co-operative operation only amongst co-routines themselves. |




浙公网安备 33010602011771号