P(mutexB)
send the mail to B; V(mutexB); V(emptyB); } } B{
While(TRUE){ P(fullB); P(mutexB)
Get a mail from B_mailbox; V(mutexB); V(fullB);
Answer the question and raise a question; P(emptyA); P(mutexA)
send the mail to A; V(mutexA); V(emptyA); } }
Code End
【考查知识点】考察了利用信号量进程同步问题。
相关推荐: