Question about Operating systems: (a) What is a process in the context of an ope
ID: 662798 • Letter: Q
Question
Question about Operating systems:
(a) What is a process in the context of an operating system? How is it possible for processes to be concurrent on systems with only one processor? Can the knowledge of the value of the program counter identify the process currently in execution? (b) What is mutual exclusion? Describe a situation where mutual exclusion is necessary. (c) (i) Suppose that several asynchronous processes operate on data held in a table containing multiple entries. A process reads an entry in the table, performs some computation on that data and then updates the same entry by storing the new value. Why is there a danger of inconsistent data being stored in the table? Show how semaphores may be used to avoid this problem. (ii) Explain carefully what happens if a process dies after reading but before updating the entry in the table.Explanation / Answer
I)
a) Process : A Process is a program in execution. The execution of a process usually progresses in a sequential fashion. In other words, a process is an entity which represents a basic unit of work that has to be implemented in a sysyem.
b) Concurrent Computing : For processes to run concurrently "Concurrent Computing" is required. In terms of programming paradigm the concept of Concurrent computing is a form of modular programming. In general concurrent programming is one where several processes are executed during overlapping time periods. There are several models of Concurrent Computing
c) The Program Counter (PC) is used by the CPU to note the address of the next instruction to be executed. It holds the address of the next process that has to be executed. The PC performs the followig steps :
Knowledge of the value of the program counter will help provide the address of the next instruction.
II) Mutual Exclusion : A way of making sure that if one process is using a shared modifiable data, the other processes will be excluded from doing the same thing. Formally, while one process executes the shared variable, all other processes desiring to do so at the same time moment should be kept waiting; when that process has finished executing the shared variable, one of the processes waiting; while that process has finished executing the shared variable, one of the processes waiting to do so should be allowed to proceed. In this fashion, each process executing the shared data (variables) excludes all others from doing so simultaneously. This is called Mutual Exclusion. However, mutual exclusion needs to be enforced only when processes access shared modifiable data - when processes are performing operations that do not conflict with one another they should be allowed to proceed concurrently.
A simple example of why mutual exclusion is important in practice can be visualized using a singly linked list (as shown). In such a linked list, the removal of a node is done by changing the
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.