Example of shared programming using library routines, Computer Engineering

Assignment Help:

Q. Example of shared programming using library routines?

Think about subsequent set of statements 

Process A                                  Process B              

   :                                                    :

fork B;                                              :

   :                                                     :

Join B;                                            end B;             

In the above group of statements process A creates a child process B by statement fork B. Then A and B carry on their computations separately till A reaches join statement At this phase if B is already completed then A continues executing subsequent statement or else it waits for B to complete. 

In the shared memory model a general problem is to synchronize the processes. It can be possible that more than one process is trying to concurrently edit the same variable. To solve this problem numerous synchronization mechanism such as test_and_set, semaphores and monitors have been used. We will not go in the details of these mechanisms. Rather we will symbolize them by a pair of two processes known as lock and unlock. Whenever a process P locks a common variable then only P can use that variable.

Other simultaneous processes have to wait for common variable till P calls the unlock on that variable. Let's see effect of locking on output of a program when we don't employ lock and when we employ lock.


Related Discussions:- Example of shared programming using library routines

Abap/4 module can "branch to " or "call" the next screen, The commands thro...

The commands through Which an ABAP/4 Module can "branch to " or "call" the next screen are Set screen Call screen , Leave screen, Leave to screen

Explain non-adapting routing, Explain non-adapting routing. Systems whi...

Explain non-adapting routing. Systems which do not implement adaptive routing are explained as using non-adapting or static routing, which routes by a network are explained by

Feature Extraction and clustering, Hi, It is a data mining project I have ...

Hi, It is a data mining project I have a CSV file that has numbers data set. The data set contains images of handwritten digits. Recognizing handwritten digits is already a mature

Define message passing, Q. Define Message Passing? The PVM communicatio...

Q. Define Message Passing? The PVM communication model offers asynchronous blocking receive and asynchronous blocking send and nonblocking receive functions. In our terminology

What does the future in gimp, Version 2.8 may bring a combined Transform to...

Version 2.8 may bring a combined Transform tool (Scale, Rotate,Flip and Perspective), more use of Cairo for attractive ant aliased graphics and more usability improvements. We will

What interprets can a browser contain besides html and http, What interpret...

What interprets can a browser contain besides HTML and HTTP? Besides an HTTP client and an HTML interpreter, a browser can have elements whihc enable the browser to perform any

What is performance testing in loadrunner, Timing for both read and update ...

Timing for both read and update transactions should be gathered to verify whether system functions are being performed in an acceptable timeframe. This should be done standalone an

Difference between the physical drive and the logical drive., A physical dr...

A physical drive is drive the in which you can physically see in the computer system itself. That is the gadget itself. Logical drive is placed inside the physical drive and th

Demonstration of sorting problem, Q. Demonstration of sorting problem? ...

Q. Demonstration of sorting problem? The term sorting implies organising elements of a provided set of elements in a specific order i.e. descending order / ascending order / al

How enterprises are using bpr in their e-business processes, One of the mos...

One of the most important competitive strategies for E-Businesses today is business process reengineering. BPR is more than automating business processes to make modest improvement

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd