Open louisom opened 7 years ago
According to p24 in this slide, thread in same priority is execute in round robin scheduling, but somehow if thread was in the busy loop, this scheduler will hang in that loop.
Also found this problem in F9-Kernel-Node where lazy y says
只是基本 kernel, idle, root, normal的priority, Normal threads當中没有priority概念,
也没有公平分配時間,會導致 thread starvation. Example:
pingpong裡面加入新thread,只做while(1) i++; ,並且在 ping&pong之前create,
會導致ping&pong無法执行。
assume ping and pong thread was create, and have following code.
ping_thread
pong_thread
main
we will get this result, after pong acquire mutex, it stuck in busy loop.
but if I add sleep for test, it work again.
result
I'll try to fix this. or maybe this just a recursive lock?