对于题意有一点问题

UVA210 Concurrency Simulator

"Should a running program attempt to execute a lock while one is already in effect, this program will be placed at the end of the blocked queue" 就是,当A程序执行了lock,那么在A程序没unlock前,只要其它程序打算执行lock(但没运行,只是检测到),就会被直接插入blocked queue中;一旦A程序unlock,便将blocked queue中的程序插回ready queue中(但其实被阻止的都是将要运行lock语句的程序,所以实际上就插回一个程序马上就会执行lock) 应该就是这样,倒是你的问题表述很令人迷惑,没怎么看懂
by Elucidator_xrb @ 2021-08-17 09:36:16


|