본문으로 건너뛰기
Modern Embedded Recipes · 108/153

ABA 문제 회피 — Tagged Pointer·Hazard·Generation Counter

· Hawk · 8분 읽기

#한 줄 요약

“ABA = CAS가 값은 같지만 의미가 다른 상황을 못 구별하는 문제.” 해결은 변경 횟수(tag)를 함께 비교하거나, 보고 있는 node가 재사용되지 못하게 하는 것입니다. 이 글은 ABA를 한 스레드에서 단계별로 재연하고, 8스레드 stack을 실제로 망가뜨린 뒤, tag가 그것을 막는 것과 16비트 tag가 한 바퀴 돌아 다시 뚫리는 것을 보여 줍니다.

#어떤 상황에서 쓰나

Lock-free stack의 pop, free list, node를 재사용하는 큐에서 나타납니다. 주차장에 비유해 보겠습니다. 내 차 자리(주소 A)를 보고 잠깐 자리를 비운 사이, 차가 빠지고 다른 차가 같은 자리에 섰습니다. 돌아와서 “A 자리에 차가 있다”만 확인하면 내 차인 줄 압니다. 번호판(tag)까지 봐야 다른 차라는 것을 압니다.

Michael(2004)은 이 문제가 IBM System/370의 CAS 문서에서 처음 보고됐고, 메모리 회수와 상관없이 막아야 하는 문제라고 적습니다. 또 GC가 ABA를 항상 막아 준다는 것은 오해이며, node를 두 리스트 사이에서 옮기는 프로그램에서는 완벽한 GC 아래서도 ABA가 난다고 덧붙입니다(Hazard Pointers, IEEE TPDS 15(6), 2.3절).

#핵심 개념

시나리오는 다음과 같습니다.

  1. T1: top을 읽어 A, A->next를 읽어 B를 얻습니다.
  2. T1이 멈춥니다.
  3. T2: A를 pop하고, B를 pop하고, A를 다시 push합니다. stack은 이제 A → C이고 B는 빠졌습니다.
  4. T1: CAS(top, A, B)가 성공합니다. top이 아직 A이기 때문입니다. 결과로 top은 이미 빠진 B를 가리킵니다.

막는 방법은 세 갈래입니다.

  1. Tag(version) — 포인터와 함께 매번 늘어나는 번호를 한 CAS로 비교합니다. 16바이트 CAS를 쓰거나, 포인터의 쓰지 않는 상위 비트에 넣습니다.
  2. Hazard pointer — 다른 스레드가 보고 있는 node는 해제·재사용하지 않습니다(9-04).
  3. RCU/epoch — grace period가 끝나기 전에는 해제하지 않습니다(9-03).

2와 3은 메모리 해제·재사용 때문에 생기는 ABA를 막습니다. 위 시나리오처럼 같은 node를 다시 push하는 경우는 해제가 없으므로 tag가 필요합니다.

#코드 / 실제 사용 예

#ABA를 한 단계씩 재연

스레드 경쟁에 기대지 않고 위 4단계를 한 스레드에서 순서대로 실행합니다. 같은 일을 일반 포인터 CAS와 {pointer, tag} 16바이트 CAS 두 가지로 합니다.

// aba_steps.cpp — the ABA interleaving replayed step by step in one thread
#include <atomic>
#include <cstdint>
#include <cstdio>
struct node { node *next; int v; };
node pool[3] = { {nullptr, 'A'}, {nullptr, 'B'}, {nullptr, 'C'} };
node *const A = &pool[0], *const B = &pool[1], *const C = &pool[2];
struct tagged { node *p; std::uint64_t tag; };
int main()
{
/* stack: A -> B -> C */
A->next = B; B->next = C; C->next = nullptr;
std::atomic<node *> top{A};
std::atomic<tagged> ttop{tagged{A, 0}};
/* T1 starts pop(): reads top and top->next, then is preempted */
node *t1_cur = top.load();
node *t1_next = t1_cur->next; // B
tagged t1_tcur = ttop.load();
/* T2 runs: pop A, pop B, push A back (A's memory reused for the same node) */
top.store(B); ttop.store(tagged{B, 1}); // pop A
top.store(C); ttop.store(tagged{C, 2}); // pop B (B is now free)
A->next = C; top.store(A); ttop.store(tagged{A, 3});// push A: stack is A -> C
/* T1 resumes */
bool ok = top.compare_exchange_strong(t1_cur, t1_next);
std::printf("plain pointer CAS: %s, top is now %c (B was already popped)\n",
ok ? "succeeded" : "failed", top.load()->v);
tagged want{t1_next, t1_tcur.tag + 1};
bool tok = ttop.compare_exchange_strong(t1_tcur, want);
std::printf("tagged CAS: %s, current tag %llu, top is %c\n",
tok ? "succeeded" : "failed", (unsigned long long)ttop.load().tag, ttop.load().p->v);
}
$ clang++ -std=c++17 -O2 aba_steps.cpp -o aba_steps && ./aba_steps
plain pointer CAS: succeeded, top is now B (B was already popped)
tagged CAS: failed, current tag 3, top is A

일반 포인터 CAS는 성공해 top이 이미 pop된 B를 가리키게 됐습니다. Tagged CAS는 tag가 0에서 3으로 바뀐 것을 보고 실패했습니다. T1은 실패한 값을 받아 다시 시도하므로 올바른 top(A)에서 출발하게 됩니다.

#8스레드에서 실제로 망가지는가

Node 64개짜리 pool을 stack에 넣고 스레드 8개가 각자 200만 번 pop한 node를 바로 push합니다. Node를 해제하지 않으므로 use-after-free는 없고, 남는 문제는 ABA뿐입니다. 끝나고 stack을 따라가며 node를 셉니다.

// aba_stress.cpp — 8 threads pop/push nodes of a fixed pool; count nodes at the end
#include <atomic>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <thread>
#include <vector>
struct node { std::atomic<node *> next; int id; }; // atomic: read while another thread may write it
constexpr int NODES = 64, THREADS = 8, OPS = 2000000;
node pool[NODES];
struct tagged { node *p; std::uint64_t tag; };
std::atomic<node *> top;
std::atomic<tagged> ttop;
bool use_tag;
node *pop()
{
if (use_tag) {
tagged cur = ttop.load(std::memory_order_acquire);
while (cur.p && !ttop.compare_exchange_weak(cur, tagged{cur.p->next.load(std::memory_order_relaxed), cur.tag + 1},
std::memory_order_acquire)) {}
return cur.p;
}
node *cur = top.load(std::memory_order_acquire);
while (cur && !top.compare_exchange_weak(cur, cur->next.load(std::memory_order_relaxed),
std::memory_order_acquire)) {}
return cur;
}
void push(node *n)
{
if (use_tag) {
tagged cur = ttop.load(std::memory_order_relaxed);
do { n->next.store(cur.p, std::memory_order_relaxed); } while (!ttop.compare_exchange_weak(cur, tagged{n, cur.tag + 1},
std::memory_order_release));
return;
}
node *cur = top.load(std::memory_order_relaxed);
do { n->next.store(cur, std::memory_order_relaxed); } while (!top.compare_exchange_weak(cur, n, std::memory_order_release));
}
int main(int argc, char **argv)
{
use_tag = argc > 1 && !std::strcmp(argv[1], "tagged");
for (int i = 0; i < NODES; i++) { pool[i].id = i; pool[i].next.store(i + 1 < NODES ? &pool[i + 1] : nullptr); }
top = &pool[0]; ttop = tagged{&pool[0], 0};
std::vector<std::thread> t;
for (int i = 0; i < THREADS; i++)
t.emplace_back([] { for (int k = 0; k < OPS; k++) if (node *n = pop()) push(n); });
for (auto &x : t) x.join();
int count = 0, seen[NODES] = {0}, dup = 0;
for (node *n = use_tag ? ttop.load().p : top.load(); n && count <= NODES; n = n->next, count++)
if (seen[n->id]++) dup++;
std::printf("%-7s nodes reachable %d of %d%s\n", use_tag ? "tagged" : "plain",
count > NODES ? -1 : count, NODES, dup ? " (cycle: a node appears twice)" : "");
}
$ clang++ -std=c++17 -O2 aba_stress.cpp -o aba_stress && ./aba_stress plain; ./aba_stress tagged # 3 rounds
plain nodes reachable -1 of 64 (cycle: a node appears twice)
tagged nodes reachable 64 of 64
plain nodes reachable -1 of 64 (cycle: a node appears twice)
tagged nodes reachable 64 of 64
plain nodes reachable -1 of 64 (cycle: a node appears twice)
tagged nodes reachable 64 of 64
$ clang++ -std=c++17 -O1 -g -fsanitize=thread aba_stress.cpp -o aba_tsan && ./aba_tsan tagged; echo exit=$?
tagged nodes reachable 64 of 64
exit=0

일반 포인터 판은 세 번 모두 stack이 고리(cycle)가 됐습니다. 같은 node가 두 번 나타나 64개를 넘어도 끝나지 않았습니다. Tag 판은 세 번 모두 64개가 정확히 남았고, TSan으로 돌려도 race 보고가 없었습니다. next를 std::atomic으로 둔 것은 한 스레드가 읽는 동안 다른 스레드가 같은 node를 push하며 쓸 수 있기 때문입니다.

#Tagged pointer (struct + 16바이트 CAS)

위 두 프로그램의 tagged 구조체가 이 방식입니다. 16바이트 CAS가 lock-free인지는 컴파일러와 런타임에 달려 있습니다. 9-05에서 같은 M2 위에서도 macOS의 Apple clang은 LSE caspal 한 명령을, Debian의 g++ 14.2.0은 libatomic의 __atomic_compare_exchange_16 호출을 만들었습니다. 후자는 is_always_lock_free가 0이었습니다.

#포인터 상위 비트에 16비트 tag

16바이트 CAS가 없거나 lock-free가 아니면, 8바이트 포인터의 쓰지 않는 상위 비트에 tag를 넣고 8바이트 CAS 하나로 처리하기도 합니다. 그 비트가 정말 비어 있는지는 OS와 하드웨어 설정이 정합니다. AArch64 Linux v6.12 문서 기준으로 정리하면 다음과 같습니다.

  • 사용자 공간 주소는 기본적으로 48비트 범위에서 나옵니다. 52비트 VA를 지원하는 커널이라도 사용자 프로그램이 48비트보다 큰 mmap hint를 주어 “opt-in”해야 52비트 주소를 받습니다(Documentation/arch/arm64/memory.rst 142–149행). 이 글의 Debian guest 커널도 CONFIG_ARM64_VA_BITS=52입니다.
  • 하드웨어는 사용자 주소의 최상위 바이트(63
    )를 주소 변환에서 무시합니다(TBI, tagged-pointers.rst 13–16행). 그래도 그 아래 55
    무시되지 않으므로, tag를 넣은 값은 dereference 전에 반드시 마스크해야 합니다.
  • MTE를 쓰면 63
    중 59
    메모리 태그 검사에 쓰입니다(memory-tagging-extension.rst 14–24행). Pointer Authentication의 PAC는 “55 minus the virtual address size” 비트를 상위에 차지합니다(pointer-authentication.rst 52–54행). 이 Debian 커널은 CONFIG_ARM64_MTE=y, CONFIG_ARM64_PTR_AUTH=y입니다.

그래서 상위 비트 tag는 “MTE·PAC를 쓰지 않는 프로세스, 48비트 주소”라는 조건을 확인한 뒤에 씁니다. 이 Mac에서 정적 객체의 주소는 상위 16비트가 0이었습니다(아래 출력 첫 줄). 다른 운영체제의 주소 배치는 이 글에서 확인하지 않았습니다.

16비트 tag의 진짜 한계는 wraparound입니다. 느린 스레드가 값을 읽은 뒤 다른 스레드들이 정확히 65,536번 갱신하면 tag가 한 바퀴 돌아 같은 값이 됩니다.

// tagwrap.cpp — a 16-bit tag in the top bits repeats after 65536 updates
#include <atomic>
#include <cstdint>
#include <cstdio>
static inline std::uintptr_t pack(void *p, std::uint16_t tag) { return (std::uintptr_t)p | ((std::uintptr_t)tag << 48); }
int main()
{
static int obj;
std::printf("&obj = %p, top 16 bits = 0x%04llx\n", (void *)&obj,
(unsigned long long)((std::uintptr_t)&obj >> 48));
std::atomic<std::uintptr_t> top{pack(&obj, 0)};
std::uintptr_t seen = top.load(); // a slow thread remembers this
for (unsigned i = 1; i <= 65536; i++) // others update 65536 times, same pointer
top.store(pack(&obj, (std::uint16_t)i));
bool ok = top.compare_exchange_strong(seen, pack(&obj, 1));
std::printf("after 65536 updates the slow thread's CAS %s\n", ok ? "SUCCEEDED (tag wrapped)" : "failed");
}
$ clang++ -std=c++17 -O2 tagwrap.cpp -o tagwrap && ./tagwrap
&obj = 0x100974000, top 16 bits = 0x0000
after 65536 updates the slow thread's CAS SUCCEEDED (tag wrapped)

65,536번 갱신 뒤 느린 스레드의 CAS가 성공했습니다. 위 8스레드 aba_stress tagged는 8스레드 × 200만 번 × (pop + push)로 CAS를 3,200만 번 성공시키는데, 이 M2 Pro에서 time으로 세 번 재면 3.455.85초였습니다. 초당 550만930만 번 갱신하는 셈이라, 65,536번은 7~12 ms면 지나갑니다. 그래서 상위 비트 tag를 쓰려면 “한 스레드가 멈춰 있는 최대 시간 × 갱신 빈도”가 2^16보다 작다는 근거가 필요하고, 그 근거가 없으면 64비트 tag(16바이트 CAS)나 hazard pointer를 씁니다.

#Hazard pointer로 회피

9-04에서 hazard pointer로 보호한 Treiber stack은 ABA에 약한 CAS를 그대로 쓰면서도 8스레드에서 ASan·TSan이 조용했고 합이 맞았습니다. 보호하는 동안 node가 해제·재사용되지 않으므로, 메모리 재사용 때문에 같은 주소가 돌아오는 경로가 막히기 때문입니다. Michael은 GC 아래에서 ABA-safe인 알고리즘이라면 hazard pointer로 GC 없이도 ABA-safe가 된다고 적습니다(2.3절). 다만 위 aba_steps처럼 같은 node를 해제 없이 다시 넣는 경우는 해당하지 않습니다.

#RCU 기반 (Linux 커널 식)

rcu_read_lock();
list_for_each_entry_rcu(e, &head, list)
process(e);
rcu_read_unlock();
/* writer, under the list's spinlock */
list_del_rcu(&e->list);
call_rcu(&e->rcu, free_entry); /* freed only after a grace period */

RCU도 reader가 볼 수 있는 동안 node를 해제하지 않으므로, 해제·재할당으로 같은 주소가 돌아오는 ABA는 생기지 않습니다. RCU list writer는 서로 spinlock으로 직렬화하므로 writer 사이의 CAS 경쟁 자체가 없습니다. 실행 예는 9-03의 rcu_list.ko에 있습니다.

#측정 / 성능 비교

위 실행 결과를 모으면 다음과 같습니다(Apple M2 Pro, macOS 27.2.1, Apple clang 21.0.0).

방식결과근거
일반 포인터 CAS단계 재연에서 CAS 성공·stack 손상, 8스레드에서 3/3 cycleaba_steps, aba_stress plain
{pointer, 64비트 tag} 16바이트 CAS단계 재연에서 CAS 실패, 8스레드에서 3/3 정상, TSan 조용aba_steps, aba_stress tagged
상위 16비트 tag65,536번 갱신 뒤 CAS 다시 성공tagwrap
Hazard pointer8스레드 Treiber stack, ASan·TSan 조용9-04

비용은 이 글에서 따로 재지 않았습니다. 16바이트 CAS가 libatomic 호출이 되는 환경에서는 그 함수의 비용을 따로 재야 하고, hazard pointer stack이 이 Mac의 단일 hot stack에서 mutex보다 느렸던 측정은 9-04에 있습니다.

#자주 보는 함정

⚠️ 16비트 tag wraparound

top.store(pack(p, (std::uint16_t)(tag + 1))); /* wraps every 65536 updates */

위 tagwrap 실행처럼 정확히 65,536번 뒤에 같은 값이 됩니다. 스레드가 멈출 수 있는 최대 시간과 갱신 빈도로 따져 봅니다.

⚠️ Tag만 비교하고 포인터는 따로

if (cur.tag == old.tag) top_ptr.store(next); /* two separate steps: not atomic */

포인터와 tag는 한 번의 CAS로 같이 비교하고 같이 바꿔야 합니다.

⚠️ 상위 비트가 비어 있다고 가정

MTE는 59

, PAC는 VA 크기에 따라 그 아래 비트를 씁니다. 52비트 주소를 opt-in한 프로세스에서는 51
주소입니다. 위 Linux 문서의 조건을 확인하지 않은 상위 비트 tag는 쓰지 않습니다.

⚠️ 포인터 CAS와 version 증가를 따로 함

top.compare_exchange_weak(cur, next);
version.fetch_add(1); /* another thread can run between the two */

두 atomic을 따로 바꾸면 그 사이에 다른 스레드가 끼어들 수 있어 version이 포인터 상태를 대표하지 못합니다. 하나의 CAS로 묶을 수 없으면 hazard pointer나 RCU로 우회합니다.

#정리

  • ABA는 CAS가 “같은 값”만 보고 그 사이의 변경을 놓치는 문제입니다. 단계 재연에서 일반 포인터 CAS는 이미 빠진 node를 top에 걸었습니다.
  • 8스레드 stack은 일반 포인터 CAS로 세 번 모두 cycle이 됐고, {pointer, tag} 16바이트 CAS로는 세 번 모두 정상이었습니다.
  • 상위 16비트 tag는 65,536번 갱신 뒤 다시 뚫립니다. AArch64 Linux에서는 MTE·PAC·52비트 VA 조건도 확인해야 합니다.
  • Hazard pointer와 RCU는 메모리 재사용으로 생기는 ABA를 막지만, 해제 없이 같은 node를 다시 넣는 경우까지 막지는 않습니다.
  • 16바이트 CAS의 lock-freedom은 컴파일러·런타임마다 다르므로 대상에서 확인합니다.

다음 편은 9-09: False Sharing 해결입니다.

#관련 항목

Modern Embedded Recipes · 109 of 153 전체 목차
  1. 1 Modern Embedded Recipes — 모던 임베디드 실전 레시피 시리즈 소개
  2. 2 디지털 신호 기초 — Voltage Level·Edge·Noise Margin·반사 분석
  3. 3 임베디드 클럭과 타이밍 — Skew·Jitter·PLL 분석
  4. 4 GPIO 내부 구조 분해 — Push-Pull·Open-Drain·Schmitt Trigger
  5. 5 UART 하드웨어 동작 분석 — Baud Rate·Framing·FIFO
  6. 6 SPI 하드웨어 분석 — Clock Mode·MOSI/MISO·Chip Select
  7. 7 I2C 하드웨어 분석 — Open-Drain·Clock Stretching·Arbitration
  8. 8 ADC 동작 원리 — SAR·Sigma-Delta 비교
  9. 9 DAC 동작 원리 — R-2R Ladder·Sigma-Delta·Settling Time
  10. 10 PWM 신호 생성 분석 — Duty·Frequency·Dead Time·Center-Aligned
  11. 11 CAN 버스 전기적 특성 — 종단·전압 레벨·GND 전위차와 1 Mbit/s 버스 길이 예산
  12. 12 RS-485·RS-422 차동 신호 분석 — Termination·Biasing·Topology
  13. 13 LVDS 차동 신호 분석 — Common-Mode·Impedance·Eye Pattern
  14. 14 ARM Cortex-M 시리즈 비교 — M0·M3·M4·M7·M33·M55 분석
  15. 15 ARM Cortex-A 시리즈 비교 — A53·A55·A72·A78·X1 분석
  16. 16 Cortex-M 레지스터 구조 분석 — R0~R15·xPSR·CONTROL·Mask Registers
  17. 17 Cortex-M4 예외 처리 — Vector Table·NVIC 우선순위·Tail-Chaining
  18. 18 ARM 메모리 맵 분석 — Normal·Device·Strongly-Ordered Region
  19. 19 Cortex-M7 캐시와 DMA — Cache Line·Write-Back·Clean/Invalidate 순서
  20. 20 Cortex-M4 MPU 활용 — Region 배치·Stack Guard·Task 격리
  21. 21 AArch64 Linux MMU 기초 — Translation Table·TLB·ASID
  22. 22 ARM TrustZone-M 기초 — Secure/Non-Secure·NSC·MPC
  23. 23 ARM Memory Barrier 실전 — DMB·DSB·ISB·DMA·MMIO
  24. 24 임베디드 크로스 컴파일러 분석 — GCC·Clang·Sysroot 구성
  25. 25 C 컴파일 4단계 — Preprocess·Compile·Assemble·Link 추적
  26. 26 ELF 파일 구조 분석 — Section·Segment·Symbol Table·DWARF
  27. 27 링커 스크립트 기초 — SECTIONS·MEMORY·entry point
  28. 28 링커 스크립트 고급 — Overlay·BSS·init_array·LMA/VMA
  29. 29 임베디드 스타트업 코드 분석 — Reset_Handler·Vector Table·SystemInit
  30. 30 C 런타임 crt0 분석 — Stack·BSS Zero·Data Copy·atexit
  31. 31 임베디드 메모리 레이아웃 — .text·.rodata·.data·.bss·.heap·.stack
  32. 32 임베디드 컴파일러 최적화 분석 — -O0~-O3·-Os·-LTO 비교
  33. 33 Map 파일 분석 — 링커가 넣은 것, 끌어온 이유, 버린 것 읽기
  34. 34 Make·CMake 크로스 컴파일 — Toolchain File·Sysroot·Preset
  35. 35 임베디드 Bootloader 체인 — BootROM·SPL·U-Boot·Kernel·Secure Boot
  36. 36 첫 bare-metal 프로그램 작성 — Linker·Startup·main의 최소 구성
  37. 37 MMIO 레지스터 직접 접근 — volatile·Memory Map·Aliasing 분석
  38. 38 GPIO 드라이버 직접 구현 — STM32F407을 HAL 없이 레지스터로
  39. 39 임베디드 클럭 설정 분석 — HSE·PLL·SYSCLK·AHB/APB 분주
  40. 40 Cortex-M 인터럽트 핸들링 — NVIC·Priority·Vector·EXTI
  41. 41 SysTick 타이머 활용 — 24-bit Counter·1ms Tick·delay 구현
  42. 42 UART 드라이버 구현 — polling·interrupt·DMA 3가지 방식 비교
  43. 43 SPI 드라이버 구현 — Master·Slave·CRC·DMA
  44. 44 I2C 드라이버 구현 — STM32F405/407 Master·Repeated START·Clock Stretching·Bus Recovery
  45. 45 임베디드 DMA 기초 — Memory-to-Memory·Peripheral·Circular Mode
  46. 46 저전력 모드 분석 — Sleep·Stop·Standby·Wake-up Source
  47. 47 STM32F405/407 IWDG·WWDG 워치독 구현 — Independent vs Window 비교
  48. 48 임베디드 Flash 프로그래밍 — Erase·Program·Read While Write
  49. 49 DDR 초기화 실패 진단 — Timing·Calibration·Walking Bit Test
  50. 50 PWM 출력 실전 — LED 밝기·모터 속도 제어
  51. 51 DC 모터 제어 — H-Bridge·PWM Duty·Encoder Feedback
  52. 52 스테퍼 모터 제어 — Full Step·Half Step·Microstepping
  53. 53 서보 모터 제어 — 50 Hz PWM·다채널·Calibration
  54. 54 Character LCD 제어 — HD44780·4-bit Mode·Custom Char
  55. 55 SPI OLED 제어 — SSD1306·Frame Buffer·Page 단위 갱신
  56. 56 TFT 디스플레이 구동 — ILI9341 SPI와 STM32F746 LTDC
  57. 57 환경 센서 활용 — BME280 온습압·SHT3x 비교
  58. 58 IMU 센서 활용 — MPU-6050·Data Ready·Complementary Filter
  59. 59 CAN 통신 구현 — bxCAN Bit Timing·Filter·Mailbox·Error 상태
  60. 60 USB Device 기초 — TinyUSB CDC·Descriptor·STM32F407 OTG_FS
  61. 61 Ethernet MAC+PHY 통합 — RMII·MDIO·lwIP Raw API
  62. 62 SD 카드 SPI 모드 + FatFs — 초기화·diskio 포팅·다중 블록 쓰기와 f_sync
  63. 63 STM32F4 RTC 활용 — Calendar·Alarm·Sub-second·Tamper·Backup Register
  64. 64 RTOS 도입 결정 분석 — Super Loop vs RTOS 트레이드오프
  65. 65 RTOS Task 설계 패턴 — 우선순위·스택·State Machine
  66. 66 RTOS Scheduler 동작 분석 — Tick·Context Switch·Yield
  67. 67 RTOS Semaphore 활용 — Binary·Counting·ISR Give
  68. 68 RTOS Mutex 활용 — Recursive·Priority Inheritance 적용
  69. 69 RTOS Queue 활용 — By-Value·By-Reference·Timeout 패턴
  70. 70 RTOS Event Group 활용 — Bit Wait·Sync·Notify
  71. 71 RTOS Software Timer 활용 — One-shot·Auto-reload·Daemon Task
  72. 72 ISR-Safe API 설계 — Reentrant·Atomic·Defer 패턴
  73. 73 Priority Inversion 진단·예방 — Mars Pathfinder Lesson 추적
  74. 74 Timer Wheel 분석 — Hashed·Hierarchical·O(1) Tick
  75. 75 RTOS 디버깅 기법 — Stack·Heap·Run-time Stats·SystemView
  76. 76 i.MX8M Mini EVK Linux 부팅 흐름 — BootROM에서 PID 1까지 단계별 인계
  77. 77 U-Boot 활용 — bootcmd·env·tftp·boot.scr 분석
  78. 78 Device Tree 실전 — DTS·DTB·Overlay·Phandle 추적
  79. 79 Device Tree Overlay 적용 — Runtime fragment·dtoverlay
  80. 80 임베디드 커널 빌드 — defconfig·menuconfig·Image·deb 패키지
  81. 81 커널 모듈 기초 — init/exit·Parameter·KBuild·modprobe
  82. 82 캐릭터 드라이버 작성 — file_operations·cdev·register_chrdev
  83. 83 Platform 드라이버 작성 — of_match·devm 해제 순서·probe 실패 판정 (Linux v6.12)
  84. 84 mmap 4가지 모드 — Anonymous·File·Shared·Huge Page
  85. 85 epoll 실전 — LT·ET·ONESHOT·EXCLUSIVE 비교
  86. 86 UIO·VFIO 분석 — User-Space Driver와 IOMMU 격리
  87. 87 sysfs·configfs 활용 — kobject 기반 User 인터페이스
  88. 88 IRQ Affinity 설정이 거부되거나 되돌아가는 이유 — smp_affinity·effective_affinity·isolcpus·irqbalance
  89. 89 루트 파일시스템 구축 — Buildroot 기초·Package·Toolchain
  90. 90 임베디드 동적 메모리 — malloc 위험·결정성·대안 분석
  91. 91 메모리 정렬과 패딩 분석 — Natural·Strict Alignment·Trap
  92. 92 Cache Line Alignment — alignas·Padding·SoA 적용
  93. 93 DMA-Friendly Allocator — dma_alloc_coherent·IOMMU·Pool
  94. 94 Zero-Copy Pipeline — DMA-BUF·sendfile·io_uring·splice
  95. 95 NUMA Memory Topology — numactl·numa_alloc·HBM 적용
  96. 96 SIMD 활용 분석 — Intrinsics·Auto-Vectorization·OpenMP SIMD
  97. 97 ARM NEON 심화 — Matrix Multiply·FFT·Image Filter 적용
  98. 98 임베디드 스택 분석 — high-water·overflow 탐지
  99. 99 임베디드 코드 크기 최적화 — -Os·LTO·Section Garbage Collection
  100. 100 임베디드 전력 최적화 — Sleep Mode·Clock Gating·DVFS
  101. 101 WCET 분석 기법 — Static·Measurement·Hybrid 방법론
  102. 102 Lock-Free Ring Buffer 구현 — SPSC·Power-of-2·Memory Order
  103. 103 Wait-Free Signaling — Atomic Flag·Sequence·Latest-Value
  104. 104 RCU (Read-Copy-Update) 기초 — Quiescent State·Grace Period
  105. 105 Hazard Pointer 분석 — Lock-Free Memory Reclamation
  106. 106 Compare-And-Swap 패턴 — Stack·Counter·Linked List 적용
  107. 107 Atomic Operation 비용 분석 — Fence·Cache Line·Contention
  108. 108 Spinlock vs Mutex 결정 가이드 — Context Switch·Hold Time
  109. 109 ABA 문제 회피 — Tagged Pointer·Hazard·Generation Counter
  110. 110 False Sharing 해결 — Cache Line Padding·Per-CPU·thread_local
  111. 111 MPMC Queue 구현 — Multi-producer Multi-consumer Lock-Free
  112. 112 임베디드 디버깅 마인드셋 — 가설·격리·재현·이분탐색
  113. 113 JTAG·SWD 안 붙을 때 — 핀·전압·속도·세션 진단
  114. 114 GDB 원격 디버깅 — OpenOCD·J-Link·target remote 구성
  115. 115 Cortex-M 하드폴트 분석 — Stacked Frame·CFSR 읽기
  116. 116 UART 안 찍힐 때 — Bare-metal 체크리스트
  117. 117 임베디드 부팅 실패 진단 — 단계별 Isolation
  118. 118 인터럽트 누락·중복 진단 — Priority·Pending·Re-entry 추적
  119. 119 메모리 오버플로우·오염 진단 — Canary·MPU·Pattern 분석
  120. 120 타이밍·Race 진단 — Heisenbug 잡는 법
  121. 121 통신 프로토콜 분석 — Logic Analyzer와 Protocol Decoder
  122. 122 임베디드 로깅 시스템 설계 — 레벨·버퍼·SWO·Deferred
  123. 123 임베디드 포스트모템 분석 — Core Dump와 Field Crash
  124. 124 FPGA 기초 분석 — LUT·FF·BRAM·DSP 자원 구조
  125. 125 Vivado 사용법 — Project·Constraint·Synth·Impl·Bitstream
  126. 126 PCIe BAR 매핑 분석 — Config Space·Enumeration·MMIO 접근
  127. 127 AXI 인터페이스 — AXI4·AXI4-Lite·AXI-Stream 비교
  128. 128 Zynq PS-PL 통신 — GP·HP·ACP 인터페이스 선택
  129. 129 Mailbox Protocol 분석 — Host와 Accelerator를 잇는 Doorbell
  130. 130 Command Queue·Submission Queue — NVMe·XDMA 공통 패턴
  131. 131 DMA Completion 메커니즘 — Interrupt·Polling·Completion Ring
  132. 132 PCIe Streaming 분석 — BAR Type·MSI-X·Kernel Bypass
  133. 133 Vitis HLS 분석 — Pragma·Pipeline II·Dataflow 실전 감각
  134. 134 HLS 최적화 기법 — Pipeline·Unroll·Partition·Dataflow
  135. 135 Vitis AI 분석 — DPU·xmodel·VART
  136. 136 OpenCL on FPGA — Kernel·Channel·Burst Memory 분석
  137. 137 Intel Quartus로 넘어가기 전 — 어느 toolchain에서나 쓰는 HDL과 testbench
  138. 138 Edge Inference 분석 — Cloud vs Edge·Latency·Privacy
  139. 139 Edge 추론 Pipeline 측정 — Stage Latency·Mailbox 정책·Buffer 수
  140. 140 NPU 아키텍처 분석 — Ethos·Hexagon·Systolic Array 비교
  141. 141 딥러닝 Quantization 분석 — PTQ·QAT·INT8·INT4·Calibration
  142. 142 TensorRT 분석 — ONNX→Engine·FP16·INT8·DLA·Multi-Stream
  143. 143 TFLite Micro 분석 — Op Resolver·Tensor Arena·Cortex-M
  144. 144 ONNX Runtime 분석 — Execution Provider와 Cross-Platform 배포
  145. 145 Edge Thermal Management — Throttling·DVFS·Fan Curve·Sustained
  146. 146 NVIDIA Jetson 분석 — Nano·Xavier·Orin·Thor·JetPack·DLA·VPI
  147. 147 Zero-Copy Camera Pipeline — V4L2·DMA-BUF·GPU Import·NPU 직결
  148. 148 온디바이스 LLM 추론 — llama.cpp·GGUF·MLX·KV Cache·NPU Backend
  149. 149 Cortex-M33 TF-M·TrustZone — Secure Firmware·PSA·MCUboot
  150. 150 Matter·Thread 분석 — IoT 통합 표준·Commissioning·Multi-Fabric
  151. 151 PCIe → CXL 진화 — 같은 PHY 위 cache-coherent 프로토콜 추가
  152. 152 QEMU CXL Type 3 디바이스 에뮬레이션 — 노트북에서 CXL 개발 환경 구축
  153. 153 Linux CXL 드라이버 분석 — cxl_pci·cxl_core·region·DAX