subject
Engineering, 12.03.2020 02:35 googoo4

CS3733: Homework/Practice 05 Suppose we would like to write a program called monitor which allows two other programs to communicate with each other through the monitor while inspecting the send messages. It can be executed as follows: > monitor progl prog2 To simplify the implementation, we assume that prog1 (e. g., 1s) will be printing some messages on the standard output while the prog2 (e. g, sort) reads from standard input and writes something into standard output. Our monitor can run these two programs as children and let the first one send messages to the second one through our monitor. So our monitor can inspect the incoming messages. After inspection, it sends the message to the next program as is. Again to simplify the implementation, we assume that our monitor simply looks for digits. When it detects a digit in the message, our monitor simply prints it on the stderr (this monitoring task can be complicated for other purposes) Logically these programs will have the following relationship prog1(child11Pie>[0Monitor (Paren)[1>Pipe2->[0Kprog2 (child2) You are asked to create the necessary pipes, child processes and connect them as explained in the above scenario. You can ignore most of the error checking to make your solution clear, but you need to close all unnecessary file descriptors and check what read-write return > monitor /bin/ls /usr/bin/sort #include #include #include #include int main (int argc, char argv int Pipel [2]; int Pipe2 [2] int chlpid, ch2pid, numread, numwrite; char buf if (chlpid.. 0){ /* child 1 7/ execl (argv[1], "progl", NULL) if (ch2pid0)/child 1 / execi (argv[2],"prog2", NULL)

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
question
Engineering, 04.07.2019 18:20
Along 8-cm diameter steam pipe whose external surface temperature is 900c connects two buildings. the pipe is exposed to ambient air at 70c with a wind speed of 50 km/hr blowing across the pipe. determine the heat loss from the pipe per unit length. (b) air at 500c enters a section of a rectangular duct (15 cm x 20 cm) at an average velocity of 7 m/s. if the walls of the duct are maintained at 100c. a) the length of the tube for an exit temperature of the air to be 40 0c. b)the rate of heat transfer from the air. c) the fan power needed to overcome the pressure drop in this section of the duct.
Answers: 1
question
Engineering, 04.07.2019 19:10
Afoot bridge is made as a simple deck, 4 m long, with a cross section 2 m (wide) and 20 cm thick, and made of wood. the deck is supported at the two ends. the maximum load allowable on the bridge is 10 tons, provided it is uniformly distributed on the deck. to sense this load, a strain gauge is placed at the center of the bridge and its resistance is monitored. if the sensor has a nominal resistance of 350 s2 and a gauge factor of 3.6, what is the reading of the strain gauge at maximum load? the modulus of elasticity for the wood used in the construction is 10 gpa.
Answers: 2
question
Engineering, 04.07.2019 19:10
Estimate the change in specific internal energy au and specific enthalpy h from inlet to outlet for ethylene glycol (a liquid) flowing through each of the following devices: (a) a heat exchanger where the glycol temperature increases from 20 °c to 80 °c; (b) a pump operating at about 25 °c and increasing the glycol pressure from 100 kpa to 8 mpa.
Answers: 2
You know the right answer?
CS3733: Homework/Practice 05 Suppose we would like to write a program called monitor which allows tw...
Questions
question
Mathematics, 28.09.2020 14:01
question
Mathematics, 28.09.2020 14:01
question
Mathematics, 28.09.2020 14:01
question
English, 28.09.2020 14:01
Questions on the website: 13722363