Answer the following questions: 1. What are the two models of interprocess commu
ID: 3853694 • Letter: A
Question
Answer the following questions:
1. What are the two models of interprocess communication? what are the strengths and weaknesses of the two approaches?
2. In what ways is the modular kernel approach similar to the layered approach? in what ways does it differ from the layered approach?
3. Consider the following C++ code that calls fork(). If you assume that the child process is always scheduled before the parent process, what will be the output?
int main()
{
int i;
for (i = 0, i < 3, i++) {
if (fork() == 0)
cout<<"Child sees i=" <<i;
else
cout<<"Parent sees i ="<<i<<endl;
}
}
Explanation / Answer
Message passing model: In this, the imparting forms trade messages with each other to exchange data. Messages can be traded between the procedures either straightforwardly or in a roundabout way through a typical letter box. Message passing is valuable for trading littler measures of information, on the grounds that no contentions require be stayed away from. It is likewise simpler to actualize than is shared memory for entomb PC correspondence.
Be that as it may, the fundamental burden is it can deal with just little measures of information.
Shared—Memory model : In this, forms utilize shared memory makes and shared memory joins framework calls to make and access districts of memory possessed by different procedures. At least two procedures can trade data by perusing and composing information in the mutual zones. Shared memory permits most extreme speed and accommodation of correspondence, since it should be possible at memory speeds when it happens inside a PC Problems exist, notwithstanding, in the regions of assurance and synchronization between the procedures sharing memory.
Message passing
1)strengths: program structures better isolated, risky operations firewalled
2)weaknesses: message passes all the more gradually, for symmetrical duplicate operations are to be made
Shared memory
1)strengths: quick and direct
2)weaknesses: sudden conduct when unauthentic projects wrongly gets to the mutual memory segments.
2.
The modular kernel approach requires subsystems to interact with each other through painstakingly developed interfaces that are ordinarily limited regarding the usefulness that is presented to outside modules. The layered portion approach is comparable in that regard. In any case, the layered piece forces a strict requesting of subsystems with the end goal that subsystems at the lower layers are not permitted to conjure operations comparing to the upper-layer subsystems. There are no such confinements in the measured bit approach, wherein modules are allowed to conjure each other with no limitations.
3.The child will run this section of code
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.