Process synchronization & concurrent cooperating processes

Asked By 40 points N/A Posted on -
qa-featured

Hi,

I am a bit confused and mixing the concepts of Critical section, process synchronization & concurrent cooperating processes as these 3 terms are used interchangeably.

I know that there is some difference in between, but I think the implementation solution is the same.

That’s why I am mixing the concept, kindly clear this ambiguity.

I am waiting for the answer of above mention question.

Thanking you.

SHARE
Best Answer by m.smith
Best Answer
Best Answer
Answered By 40 points N/A #128264

Process synchronization & concurrent cooperating processes

qa-featured

Hi friend, how are you. Hope you will be fine. My name is M.Smith and doing job in a multinational company.

Ok I saw your question which is so interesting.

Now the answer of your question is  that the Critical section is a piece of code which is shared between processes.

It means that several processes can access that code at the same time.

But we do not want that shared code be accessed by every process at any time. In fact we want to synchronize their execution i.e. when one process is executing a shared piece of code then no other process should be able to modify it otherwise it could result in an incorrect result.

And concurrent processes are those processes that can run simultaneously.

For example if you create a child process using fork system call then a child process is created. This child and parent process can run simultaneously. This simultaneous running processes are called concurrent processes.

 You should follow all the steps after that you will feel that its so easy question. If you have anymore questions then you can tell me freely.

God bless you.

Answered By 0 points N/A #128265

Process synchronization & concurrent cooperating processes

qa-featured

Hope the below explanation could helps.

Concurrent Processes

Data inconsistency might be resulted from the data sharing in a concurrent process. To maintain consistency of data, mechanisms are required to monitor that the cooperating processes are orderly executed.

A typically Producer – Consumer error

Data is created in one thread and stored in a shared object. Then the data is read by second thread from the same object.  For example, characters are produced by a print program and simultaneously a printer shares the same characters. Both the program and the printer use common area to buffer and store the characters.

Critical Section

In concurrent programming, when the code is executing and manipulating the shared resource or shared data, it is called Critical Section. These critical sections must be executed mutually exclusive that one and only one process is allowed to access to a critical section to execute at any specific time (even there are multiple processors).

Each process is required to have the permission to access its critical section.

Happy programming.

Related Questions