Question

In: Computer Science

A program P1 sends its output to another program P2. Let R1 be the range of...

A program P1 sends its output to another program P2. Let R1 be the range of P1 and D2bethe domain of P2. Discuss with concrete examples, the implication that the range of P1 does not equal the domain of P2(i.e. R1 != D2 or R1 <> D2).What behaviors would you expect from P2 when it receives and processes the output from P1? Consider the different situations of this implication.

Solutions

Expert Solution

When one program output depends on the another program then it comes under category of coupling precisely tightly coupling , As a developer or Software Engineer one needs to avoid tightly coupled codes the reason is it may leads to faults or wrong answers , the basic thing you need to do is modularizing the code by decreasing coupling of code .

In the above Scenario , P2 depends on the output of P1 , for an example let us consider the code of P1 is struck with some issue then P2 wont complete its process and it would be waiting for the completion of P1 process which leads to waste of resource management and code breakage .

Also when one implements multi threading in P1 then the process P1 may run into false outputs , if one doesn't clearly uses synchronization and uses lock and key process . In many code areas values get assigned before updation if there is no synchronization block . So one should take care of threading in use of process dependent code or tightly coupled

It Increases Latency , CPU resources gets wasted , in broader view for process P2 to execute it waits for P1 which will take some time to execute and then P2 will execute . If they would not have been code dependent then parallel code execution would have possible which leads to decrease in latency and code cpu resources would have effiicently used

Major Problem Would be latency What if Process P1 runs into infinte loop !!! then theroretically P2 to execute it takes infinite time !! but compiler stops after 10s if the loop goes infinite in condition .


Related Solutions

Let B = (p0, p1, p2) be the standard basis for P2 and B = (q1,...
Let B = (p0, p1, p2) be the standard basis for P2 and B = (q1, q2, q3) where: q1 = 1 + x , q2 = x + x 2 and q3 = 2 + x + x 2 1. Show that S is a basis for P2. 2. Find the transition matrix PS→B 3. Find the transition matrix PB→S 4. Let u = 3 + 2x + 2x 2 . Deduce the coordinate vector for u relative to...
For developing countries in Africa and the Americas, let p1 and p2 be the respectiveproportions of...
For developing countries in Africa and the Americas, let p1 and p2 be the respectiveproportions of babies with a low birth weight (below 2500 grams). A randomsample of n1 = 2000 African women yielded y1 = 750 with nutritional anemia anda random sample of n2 = 2000 women from the Americas yielded y2 = 650 womenwith nutritional anemia. We shall test H0: p1 = p2 against the alternative hypothesisH1: p1 > p2 at α = 0.05. 1. What is the...
module traffic(clk, reset, P1, P2, P3, P4, PL); input clk; input reset; output[4:0] P1; output[4:0] P2;...
module traffic(clk, reset, P1, P2, P3, P4, PL); input clk; input reset; output[4:0] P1; output[4:0] P2; output[4:0] P3; // four roads output [4:0] P4; output[3:0] PL; //Pl is pedestrian reg [4:0] P1; reg [4:0] P2; reg [4:0] P3; reg [4:0] P4; reg [3:0] PL; reg [4:0] sig; always @(posedge clk or negedge reset) begin    if(reset == 1'b0)begin        P1 <= 5'b00100;        P2 <= 5'b00100;        P3 <= 5'b00100;        P4 <= 5'b00100;       ...
For developing countries in Africa and the Americas, let p1 and p2 be the respective proportions...
For developing countries in Africa and the Americas, let p1 and p2 be the respective proportions of babies with a low birth weight (below 2500 grams). A random sample of n1 = 2000 African women yielded y1 = 750 with nutritional anemia anda random sample of n2 = 2000 women from the Americas yielded y2 = 650 women with nutritional anemia. We shall test H0: p1 = p2 against the alternative hypothesis H1: p1 > p2 at α = 0.05.
If a 95% confidence interval for two population proportions p1-p2 is a range of positive numbers,...
If a 95% confidence interval for two population proportions p1-p2 is a range of positive numbers, then what does this imply? a) The relative size of the population proportions cannot be determined b)With 95% confidence, there is no difference in the population proportions. c) With 95% confidence, the first population proportion is greater than the second. d) With 95% confidence, the first population proportion is less than the second.
Let p1 and p2 be the respective proportions of women with iron-deficiency anemia in each of...
Let p1 and p2 be the respective proportions of women with iron-deficiency anemia in each of two developing countries. A random sample of 2000 women from the first country yielded 439 women with iron-deficiency anemia, and an independently chosen, random sample of 1700 women from the second country yielded 316 women with iron-deficiency anemia. Can we conclude, at the 0.05 level of significance, that the proportion of women with anemia in the first country is greater than the proportion of...
Let P1 = number of Product 1 to be produced P2 = number of Product 2...
Let P1 = number of Product 1 to be produced P2 = number of Product 2 to be produced P3 = number of Product 3 to be produced P4 = number of Product 4 to be produced Maximize 15P1 + 20P2 + 24P3 + 15P4 Total profit Subject to 8P1 + 12P2 + 10P3 + 8P4 ≤ 3000 Material requirement constraint 4P1 + 3P2 + 2P3 + 3P4 ≤ 1000 Labor hours constraint P2 > 120 Minimum quantity needed for...
Let P1 = number of Product 1 to be produced P2 = number of Product 2...
Let P1 = number of Product 1 to be produced P2 = number of Product 2 to be produced P3 = number of Product 3 to be produced P4 = number of Product 4 to be produced Maximize 15P1 + 20P2 + 24P3 + 15P4 Total profit Subject to 8P1 + 12P2 + 10P3 + 8P4 ≤ 3000 Material requirement constraint 4P1 + 3P2 + 2P3 + 3P4 ≤ 1000 Labor hours constraint P2 > 120 Minimum quantity needed for...
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4...
Let pi = P(X = i) and suppose that p1 + p2 + p3 + p4 = 1. Suppose that E(X) = 2.5. (a) What values of p1, p2, p3, and p4 maximize Var(X)? (b) What values of p1, p2, p3, and p4 minimize Var(X)?
Let p1 and p2 be the respective proportions of women with iron-deficiency anemia in each of...
Let p1 and p2 be the respective proportions of women with iron-deficiency anemia in each of two developing countries. A random sample of 2000 women from the first country yielded 447 women with iron-deficiency anemia, and an independently chosen, random sample of 2300 women from the second country yielded 467 women with iron-deficiency anemia. Can we conclude, at the 0.01 level of significance, that the proportion of women with anemia in the first country is greater than the proportion of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT