Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.2k views
in Technique[技术] by (71.8m points)

operating system - When is the use of semaphores needed? (with 4 cases included as examples)

So I am asked to find from which of these four cases is a semaphore needed to avoid the creation of a deadlock. I am not sure I have grasped this idea yet, so some help would be appreciated!

  1. Keyboard
  2. Network Card (wifi)
  3. A space in memory which can be accessed by many process for change in the data (e.g. shared memory)
  4. Reading from a optical disk

If I were to guess, I wound probably go with number one only, because the keyboard has to be accessed by only one process at a time. However, I am not sure about any of these. Thanks :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...