Re: question about the exchanges of td-td_lock and mtx in sched_switch() of sched_ule

2011-10-24 Thread Attilio Rao
2011/10/13 Haozhong Zhang snowzh8...@gmail.com: Hi, I'm recently reading the code of sched_ule in freebsd 8.2.0 and have two questions. 1. sched_switch() (in sched_ule.c) invokes cpu_switch() (at line 1852) and thread_unblock_switch() (at line 1867). These two functions exchange td-td_lock

question about the exchanges of td-td_lock and mtx in sched_switch() of sched_ule

2011-10-13 Thread Haozhong Zhang
Hi, I'm recently reading the code of sched_ule in freebsd 8.2.0 and have two questions. 1. sched_switch() (in sched_ule.c) invokes cpu_switch() (at line 1852) and thread_unblock_switch() (at line 1867). These two functions exchange td-td_lock and mtx. What are the purposes of these exchanges?