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

Write a short note on pointer operators in c, Write a short note on pointer...

Write a short note on pointer operators in c Pointers (that is, pointer values) are generated with the ''address-of'' operator &, which we can also think of as the ''pointer-to

Represent negative numbers in the computer system, Q. What are the values o...

Q. What are the values of x, y, and z. (1011.001101)2 = (x)10 = (y)8 = (z)16 Q. What are the various ways to represent Negative Numbers in the Computer system?

Intel architecture – 64, IA-64 (Intel Architecture-64) is a 64-bit processo...

IA-64 (Intel Architecture-64) is a 64-bit processor architecture created in cooperation by Hewlett-Packard and Intel applied by processors like Itanium. The objective of Itanium wa

How to copy files from a drive and directory, Q. How to copy files from a d...

Q. How to copy files from a drive and directory? You can copy files from a drive and directory other that the currently selected one. However in that case, you need to speci

Bit manipulation techniques, We can also use the logical operators to numbe...

We can also use the logical operators to numbers directly and  perform simple bit manipulation . The operators are     &  Bitwise AND     |  Bitwise OR     ^  Bitwise exclusiv

Joint application development session leader, Q.Joint Application Developme...

Q.Joint Application Development session leader? JAD session leader: JAD leader organizes and runs the JAD. This person is trained in group management and facilitation as well

Standards used for development of a system, Q. Standards used for developme...

Q. Standards used for development of a system? Documentation standards: It must be an ongoing activity at the time of system development life cycle.  Quality Standards:

Explain time division switching, Explain Time Division Switching. Ti...

Explain Time Division Switching. Time Division Switching: A switching component can be shared at the same time with number of active speech circuits. It is the principle of

What are the advantages of CMOS logic, What are the advantages of CMOS logi...

What are the advantages of CMOS logic Ans: Advantages of CMOS Logic: (i) The power dissipation is mini-mum of all the logic families (ii) LSI and VLSI are possible

Explain about mmx architecture, Explain about MMX architecture MMX arc...

Explain about MMX architecture MMX architecture introduces new packed data types. Data types are eight packed, consecutive 8-bit bytes; four packed, consecutive 16-bit words;

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