Lab 6 Uthread: switching between threads
Design the context switch mechanism for a user-level threading system
Task
Expected Result
~/classes/6828/xv6$ **make qemu**
…
$ **uthread**
thread_a started
thread_b started
thread_c started
thread_c 0
thread_a 0
thread_b 0
thread_c 1
thread_a 1
thread_b 1
…
thread_c 99
thread_a 99
thread_b 99
thread_c: exit after 100
thread_a: exit after 100
thread_b: exit after 100
thread_schedule: no runnable threadsHints
Solution
Save registers info in thread
threadAdd context to thread.
Setup jump function and stack in thread creation
Implement context switch
Complete thread scheduler
Ref: Full Uthread Package
心得
Last updated