Operating System unit 3
Que:-1 What is Concurrency? Explain it with example.
Ans:-
- It refers to the execution of multiple instruction sequences at the same time.
- It occurs in an operating system when multiple process threads are executing concurrently.
- These threads can interact with one another via shared memory or message passing.
- Concurrency results in resource sharing, which causes issues like deadlocks and resource scarcity.
- It aids with techniques such as process coordination, memory allocation, and execution schedule to maximize throughput.
Message Passing provides a mechanism to allow processes to communicate and to synchronize their actions without sharing the same address space.
For example − chat programs on World Wide Web.
Now let us discuss the message passing step by step.
Step 1 − Message passing provides two operations which are as follows −
Send message
Receive message
Messages sent by a process can be either fixed or variable size.
Step 2 − For fixed size messages the system level implementation is straight forward. It makes the task of programming more difficult.
Step 3 − The variable sized messages require a more system level implementation but the programming task becomes simpler.
Step 4 − If process P1 and P2 want to communicate they need to send a message to and receive a message from each other that means here a communication link exists between them.
Step 5 − Methods for logically implementing a link and the send() and receive() operations.
Given below is the structure of message passing technique −
Comments
Post a Comment