Try   HackMD

2025q1 Homework4 (quiz3+4)

contributed by <Urbaner3>

回答第 3 周測驗題從測驗一到測驗五和第 4 周測驗題從測
藍圖

week 3; week 4

quiz3c

​​​​AAAA = ENV_RUNNABLE: When creating a new thread, we set its status to runnable so that it can be selected by the scheduler.

​​​​BBBB = 1: In the scheduler, we increment the current environment ID by 1 to find the next candidate thread to run (with wrap-around using modulo).

​​​​CCCC = coro_schedule(): After saving the context in coro_yield(), we call the scheduler to switch to another thread.

​​​​DDDD = coro_yield(): In the preemption signal handler, we force a context switch by calling coro_yield().

quiz4b

浮點數運算 回憶定義,