# 第 14, 15, 16 週課堂問答 > [期末專題](https://hackmd.io/@sysprog/linux2023-projects) ## JIT * mmap system call * mprotect system call macOS -> https://keith.github.io/xcode-man-pages/pthread_jit_write_protect_np.3.html ## simrupt * [User Space interrupt](https://www.kernel.org/doc/html/v5.0/driver-api/uio-howto.html) * softirq v.s irq * Why `simrupt`? * 為何 web server 需要 kernel thread? ## Week15 > [測驗題](https://hackmd.io/@sysprog/linux2023-quiz15) SPSC queue producer 主要操作是 enqueue() consumer 主要操作是 dequeue() spinlock [ T: 2 ] producer 7 cycles/op consumer: 7 cycles/op [ T: 3 ] producer 8 cycles/op consumer: 16 cycles/op [ T: 4 ] producer 7 cycles/op consumer: 21 cycles/op [ T: 5 ] consumer: 37 cycles/op producer 9 cycles/op 如何設計實驗,來驗證「lock-free: 強調以系統的觀點來看,只要執行足夠長的時間,至少會有一個執行緒會有進展 (progress)」這個屬性? real-time (WCET): https://en.wikipedia.org/wiki/Worst-case_execution_time consumer 裡頭的 assert((old_value + 1) == value) 在檢查什麼條件? producer 總是產生嚴格遞增的數列 ==> 如何驗證 producer,如果要加入 assert 來驗證,怎麼做? ==> 如何驗證 queue > 我在想 consumer 會不會有 race condition 的可能? 因為 self->tail.w 會同時被多個執行緒修改,且不是用 atomic 的方式做? > > yanjiew1 加入 Thread Sanitizer `-fsanitize=thread` 機率 quiz16 ABA problem drop 的定義 slots[] 如何避免編譯器在最佳化的時候,把沒有顯式分支的程式加上分支?
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.