Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 12, Problem 12.34HW
Program Plan Intro
I/O Multiplexing:
- The idea of I/O multiplexing is to use “select” function to ask kernel to suspend process.
- It returns control to application only after one or more I/O events had occurred.
- It denotes waiting for a set of descriptors that is ready for reading.
- The “select” function would manipulate sets of type “fd_set”, that denotes descriptor sets.
- It takes two inputs: a descriptor set called “read set” and cardinality of read set.
- It blocks until at least one descriptor in read set is ready for reading.
- A descriptor “k” is ready for reading if and only if a request to read 1 byte from that descriptor would not block.
- The “fd_set” is been modified that points to argument “fdset” to indicate subset of read set called “ready set”.
- The value returned by function indicates cardinality of ready set.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Determine the difference between parallelism and pipelining.
Q: One way to handle parameter conversion in RPC systems is to have each
machine send parameters in its native representation, with the other one doing
the translation, if need be. The native system could be indicated by a code in
the first byte. However, since locating the first byte in the first word is pre-
cisely the problem, can this actually work?
Refer to the code below determine whether this code is correct, and if not, correct any mistakes. Find the speedups and efficiencies of the parallel odd-even transposition. Does the program obtain linear speedups? Is it scalable? Is it strongly scalable? Is it weakly scalable? After correcting the mistakes, execute the code in CUDA or OpenMP and measure any performance improvement in terms of speedups and scalability.
Process Pi
evenprocess =(i%2 ==2);
evenphase = 1;
for(step =0; step < n; step++,evenphase = !evenphase)
{
if((evenphase && evenprocess) || (!evenphase && !evenprocess)
{
send (&a, Pi+1);
recv (&x, Pi+1);
if (x<a) a =x;
}
else {
recv (&x, Pi-1);
send (&a, Pi-1);
if (x > a) a = x;
}
}
Chapter 12 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 12.1 - Prob. 12.1PPCh. 12.1 - Prob. 12.2PPCh. 12.2 - Practice Problem 12.3 (solution page 1036) In...Ch. 12.2 - Practice Problem 12.4 (solution page 1036) In the...Ch. 12.4 - Prob. 12.5PPCh. 12.4 - Prob. 12.6PPCh. 12.5 - Prob. 12.7PPCh. 12.5 - Prob. 12.8PPCh. 12.5 - Prob. 12.9PPCh. 12.5 - Prob. 12.10PP
Ch. 12.6 - Prob. 12.11PPCh. 12.7 - Prob. 12.12PPCh. 12.7 - Prob. 12.13PPCh. 12.7 - Prob. 12.14PPCh. 12.7 - Prob. 12.15PPCh. 12 - Prob. 12.20HWCh. 12 - Derive a solution to the second readers-writers...Ch. 12 - Prob. 12.22HWCh. 12 - Prob. 12.23HWCh. 12 - Prob. 12.24HWCh. 12 - Prob. 12.25HWCh. 12 - Prob. 12.26HWCh. 12 - Some network programming texts suggest the...Ch. 12 - Prob. 12.28HWCh. 12 - Prob. 12.29HWCh. 12 - Prob. 12.30HWCh. 12 - Implement a version of the standard I/O fgets...Ch. 12 - Prob. 12.32HWCh. 12 - Prob. 12.33HWCh. 12 - Prob. 12.34HWCh. 12 - Prob. 12.35HWCh. 12 - Prob. 12.36HWCh. 12 - Prob. 12.37HWCh. 12 - Prob. 12.38HWCh. 12 - Prob. 12.39HW
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Choosing a good pivot and a good cut-off value for the quicksort may boost its performance.arrow_forwardIn an RISC V (32-bit) microprocessor, if a0 is preloaded with data of Ox0000_1F75 and al is preloaded with data of Ox0000_32CB, then what are the values of s0 (in Hex) after each of the following logical operations (in sequence)? xor s0, a0, al xori s0, s0, 0XFFFF slli s0, s0, 16arrow_forwardWrite an ARM assembly program to check whether an N x N matrix is a magic square. A magic square is an N x N matrix in which the sums of all rows, columns, and the two diagonals add up to N(N + 1)/2. All matrix entries are unique numbers from 1 to N. If the matrix is a magic square, register RO will be set (i.e. all ones) upon completion; otherwise it will be cleared. Test the following matrix 16 5 9 4 3 10 6 15 2 11 7 14 13 8 12 1 Store the matrix element numbers in memory starting at location 0x20004000. Assume all numbers are Bytesarrow_forward
- For this task we are going to use ENet architecture. You can read the description in the original paper. To generate two different outputs we need to have two different branches. In the LaneNet paper authers proposed to share only two first sections of the encoder between to tasks. Third section and decoder should be separate for the instance segmentation and binary segmentation problem. The output dimension of the instance segmentation embedding should be equal to 5. class ENet(nn.Module): def__init__(self): super(ENet, self).__init__() def forward(self, x): # code herearrow_forwardImplement c/c++ to evaluate round robin algorithm with i/o burst.I want my code to able to read csv. The link is to my csv file https://jpst.it/2IURz. The code must also have input for quantum time. The code must contain this following:(i) Turnaround time of the jobs;(ii) Waiting time of the jobs; and(iii) Number of interrupts incurredarrow_forwardTask: Given two matrices X and Y, multiply them in parallel to store the result in matrix Z You should write an openMP program with the following points in consideration: Analyze the speedup and efficiency of the parallelized code. Vary the size of your matrices from 100,1000, and 2000 and measure the runtime with one thread. For each matrix size, change the number of threads from 2,4,8., and plot the speedup versus the number of threads. Compute the efficiency. Explain whether or not the scaling behavior is as expected.arrow_forward
- This a High-Performance Computing Question: Assume you have the code of a Naïve parallel version of Matrix-Matrix multiplication using CUDA and C++ in this way:(A Naïve parallel version of Matrix-Matrix multiplication using CUDA and C++(Note that the kernel should do the multiplication).Use square matrices.Use 1D execution configurations so that a thread loads a whole. The code has 4 different sizes of matrices over 1000, use 2 different block sizes.) Provide the code using CUDA and C++ for an OPTIMIZED parallel version of a Matrix-Matrix multiplication with CUDA and by "Varying the size of your computational grid: change number of CUDA threads and blocks ". Requirements:Compare that results are correct by comparing the results with cubLAS'.Use double-precision for all the programUse square matrices.Calculate the time that it took for the kernel to do the multiplication.Calculate the time that it took since transferring the matrices from host to device up to retrieving the results…arrow_forwardWrite a C program that reads the values of two 2x2 arrays from the user. The program should fork a child process. Have your main process compute and display the sum of the two matrices, while the child process computes and displays the product of the two matrices. Ensure that the child process displays the product matrix before the main process displays the sum matrix.arrow_forwardIn a computer with a 32-bit data-bus, how many 4-bit wide memory components are used? the answer to this part is 32/4 = 8 components (2-bit wide) I need the answer to part two, please If the size of each 4-bit memory component is 4 x n cells where n = 1G (i.e., 4 x n uniquely addressable locations—n : row, 4 : 2 column/width), what is the total capacity of the memory system? Show your answer in power of 2. (hint: 1000 ~ 210)arrow_forward
- Write an openMP program that calculates the integration of the following function F(x) = 2 x° - x? +2 x For the interval 0 to 5. Processor will be assigned equal parts of the interval to calculate its integration. Let the user enter the number of trapezoids for each interval. Time your execution for different number of processors (2-8). Report your findings.arrow_forwardConsider a program where 95% of the code can be parallelized. If you have aninfinite number of processors, what is the maximum speedup possible accordingto Amdahl's Law?arrow_forwardThere is an application that requires the following hardware: an Intel 8031, a Program ROM of 8Kx8, a Data ROM of 4Kx8 for look-up tables and a Data RAMs of 8Kx8. The memory map of the design: Program ROM should start at address 0000H. Then, the Data ROM should come above the Program ROM. Finally the Data RAM must go to the top of the memory map. There should be no gaps between the memory addresses of the external ROMs. Calculate the address space of the ROMs and RAMs of your design.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education