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

Can you list out some of enhancements in verilog 2001, Can you list out som...

Can you list out some of enhancements in Verilog 2001? In  earlier  version  of  Verilog,  we  use  'or'  to  specify  more  than  one  element  in  sensitivity  list.  In Veri

Characteristics of a computer memory systems, Question: a) Describe wha...

Question: a) Describe what is meant by a "bus". There are two types of bus, dedicated and multiplexed. Give a brief description of both types of buses. b) Briefly explain f

Universal serial bus - computer architecture, Universal Serial Bus - comput...

Universal Serial Bus - computer architecture: USB   Universal Serial Bus   Speed Low-speed(1.5 Mb/s) High-speed(480 Mb/s) Full-speed(12 Mb/s)   De

Features of read-only memory, Q. Features of read-only memory? ROMs are...

Q. Features of read-only memory? ROMs are memories on which it's not possible to write data when they are on-line to computer. They can only be read. This is reason why it is k

Flowchart, How to calculate the flowchart

How to calculate the flowchart

What do you meant by extranets, Extranets can be also used to connect an in...

Extranets can be also used to connect an intranet to Internet so that remote offsite access can be made in a company's intranet by an authorized individual. This can facilitate thr

What is difference between hold time and setup, What is difference between ...

What is difference between hold time and setup? The interviewer was looking for one exact reason, and it’s really a good answer as well..The hint is hold time doesn't depend onto c

Computer graphics, raster scan and random display technology

raster scan and random display technology

What is set screen, SET SCREEN With SET SCREEN the present screen simpl...

SET SCREEN With SET SCREEN the present screen simply specifies the next screen in the chain , control branches to this next screen  as soon as the current screen has been proce

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