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

Describe the bespoke versus off-the-shelf software, Bespoke versus off-the-...

Bespoke versus off-the-shelf software Generally software packages are bought off-the-shelf. Though, certain applications (generally for industrial companies, commercial busines

State about the behavioral modeling, State about the Behavioral modeling ...

State about the Behavioral modeling Behavioral means how hardware behaves determine exact way it works we write using HDL syntax. For complex projects it's better mixed approac

What is the difference among save and save as, Use SAVE when you are revisi...

Use SAVE when you are revising an existing document. Use SAVE AS when you are making a new document from scratch or an existing document. This will remain the original document

Soundness - artificial intelligence, Soundness - artificial intelligence: ...

Soundness - artificial intelligence: You may see in some application domains-for example automated theorem proving - that your search is "sound and complete". The soundness in

Minimum possibility -minimax algorithm, Minimum possibility -minimax algori...

Minimum possibility -minimax algorithm: Finally, we want to put the scores on the top edges in the tree. So there is over again a choice. Whenever, in this case, we have to r

Should validation occur server-side or client-side, Should validation (did ...

Should validation (did the user enter a real date) occur server-side or client-side? Why? Validation will be done in both sides i.e., at the server side and client side. Ser

For which class address 192.5.48.3 belogs, Address 192.5.48.3 belongs to? ...

Address 192.5.48.3 belongs to? Address 192.5.48.3 belongs to class C.

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