17. CPU
cpu1 cpu2
memory core core core core memory
1 2
core core core core
Sunday, July 17, 2011
18. if (th->interrupt_flag) {
gvl_release();
sched_yield();
gvl_acquire();
}
•gvl_release() gvl_acquire() sched_yield()
• sched_yield() yield
Sunday, July 17, 2011
19. sched_yield
• Unix API
http://pubs.opengroup.org/onlinepubs/009695399/
functions/sched_yield.html
int sched_yield(void);
• The sched_yield() function shall force the
running thread to relinquish the processor
until it again becomes the head of its
thread list.
•
Sunday, July 17, 2011