题目内容

A database is shared among several concurrent processes. Reader processes want only to read the database, whereas writer processes want to update the database. Readers can access the shared data simultaneously, while the writers should have exclusive access to the shared database. Now you need to solve the problem using semaphores.The semaphore mutex is used to ensure mutual exclusion when the variable readcount is updated. he readcount variable keeps track of how many processes are currently reading the object. The semaphore wrt functions as a mutual-exclusion semaphore for the writers.(1) Initialize the semaphore mutex and wrt.(2 points)(2) Given the code of writer processes, please write the code of reader processes.(8 points)

查看答案
更多问题

磁粉检测能检查出的缺陷是:

A. 钢板壁厚的减薄
B. 钢锭中心的气孔
C. 钢棒表面的裂纹
D. 与磁力线方向平行的发纹

下列哪些材料可以进行磁粉检测?

A. LY12
B. 1Cr13
C. 1Cr18Ni9Ti
D. TC4

钢材表面裂痕最适合的检测方法是哪一种?

A. 超声波检测
B. 射线检测
C. 渗透检测
D. 磁粉检测

下列哪些材料不能进行磁粉检测?

A. 顺磁性材料
B. 非金属材料
C. 陶瓷材料
D. 铁磁性材料

答案查题题库