Practical RTOS Internals
Queue 내부 구현 추적 — Ring Buffer·2 Wait Lists·Atomic Send/Receive
FreeRTOS Queue 코드 — pcWriteTo·pcReadFrom·uxMessagesWaiting + xTasksWaitingToSend/Receive.
· 3분 읽기
queue ring-buffer
7개의 포스트
FreeRTOS Queue 코드 — pcWriteTo·pcReadFrom·uxMessagesWaiting + xTasksWaitingToSend/Receive.
공유 자원 보호의 3가지 도구로 interrupt disable, spinlock, mutex가 있습니다. 언제 어느 것을 쓰는지 정리합니다.
Atomic, CAS, memory order — mutex 없이 동시성. 임베디드의 ISR-safe 패턴.
memory_order별 ARM 명령어 차이, LSE vs LL/SC, hot spinning 회피까지 atomic 연산의 실측 비용을 정리합니다.
CAS loop, strong과 weak CAS, ABA 회피, exponential backoff, spurious failure까지 CAS 사용의 표준 패턴을 정리합니다.
SPSC ring 구현. Power-of-2 size, head/tail atomic, memory order release/acquire.
ISR 안전 함수 작성. Reentrant, atomic 변수, deferred work, FromISR variant.