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.23HW
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
Computer Science
C programming
Develop a proxy HTTP server that can accept HTTP requests from clients and convert them to HTTPS request to the web server.
The HTTP request can be filtered based on an access control list.
The requests can be generated by any web client, such as the curl command or a web browser.
the proxy converts plain text HTTP requests from a client to HTTPS requests and then returns the responses to the client.
Main objective is to create a proxy HTTP server that converts cleartext HTTP requests from clients to HTTPS requests to servers and vice versa for the responsesresponses.
Currently, the web server handles only one HTTP request at a time. Implement a multithreaded server
that is capable of serving multiple requests simultaneously. Using threading, first create a main thread
in which your modified server listens for clients at a fixed port. When it receives a TCP connection
request from a client, it will set up the TCP connection through another port and services the client
request in a separate thread. There will be a separate TCP connection in a separate thread for each
request/response pair.
Suppose an HTTP client makes a first GET request to the gaia.cs.umass.edu web server for a base page that it has never before requested, which contains an embedded object, which causes the client to make a second GET request. A very short time later, the client then makes a third GET request - for the same base page, with that third GET request having an If-Modified-Since field (as does the 4th GET request that the client makes for the embedded object). Neither the base object nor the jpeg object has changed.
How many round trip times (RTTs) are needed from when the client first makes the third GET request (i.e., when it requests the base object for the second time) to when the base page and the jpeg file are displayed a second time, assuming that:
any time needed by the server to transmit the base file, or the jpeg file into the server's link is (each) equal to 1/2 RTT
the time needed to transmit an HTTP GET into the client's link is zero?
the time needed by the server to transmit…
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
- Consider accessing your e-mail with POP3. Suppose you have configured your mail client to operate in the 'download-and-delete' mode. When the client (C) fetches all emails from the server (S), the sequence of messages exchanged starts as follows. C: list S: 1 498 S: 2 912 S: C: retr 1 S: blah blah S: How many messages does the server store for the client? blah It cannot be known 912 498 None of the mentionedarrow_forwardServers can be designed to limit the number of open connections. For example, a server may wish to have only N socket connections at any point in time. As soon as N connections are made, the server will not accept another incoming connection until an existing connection is released. Please write pseudo code to implement the synchronization using semaphore.arrow_forwardQ.7. Design and implement a client/ Multi-threaded Server Chat application where a set of clients are able to send their request to the Multithreaded Server. In this application, messages that are exchanged between client and server, must be encrypted using AES encryption algorithm. After receiving the message, each party (client or server) perform decryption operation and show the content of message on the terminal.arrow_forward
- Create a performance-testing client that executes T trials of the following experiment using an int value T from the command line: Use UnionFind to identify connectivity as in our development client, and loop until all sites are connected, to create the connections in an N-by-N square grid with random orientation and order. Print the value of N, the average number of connections handled, and the running duration relative to the previous value for each N. Use your programme to verify the text's assertions that weighted quick-union is almost linear and that quick-find and quick-union have quadratic running times. Note : As N doubles, the number of sites in the grid increasesby a factor of 4, so expect a doubling factor of 16 for quadratic and 4 for linear.arrow_forwardComputer Science Networks and should be done in C language. Create a UDP client and server program that not only is able to locally transfer files but it gives the client the ability to send multiple copies of the file to multiple servers. Once the server program is initiated, it waits until it receives client packets. It then reads and saves the payload of the packets. The client reads a file from the disk and sends it to each server over a UDP socket by breaking the file up into mtu-byte sized packets. Client needs to be concurrent in sending the packets to all of the servers using threadsarrow_forwardLanguage : C / C++ / Python Develop a simple Web server (parity generator) that is capable of processing the request from client. Create a socket connection, when contacted by the client the server has to process the request and give back the result. Client part The client has to send the data in bits (e.g 1100011000). It also has to send the number of frames it has to separate the data (e.g. 2 frames) Server part Server has to split the data into 2 parts (Frame 1 -> 11000; Frame 2 ->11000) and send back to the client. For each part server has to find the even parity and sendarrow_forward
- Computer Science Control an LED Remotely using TCPDUMP Must be implemented on the RPI 3B+ using a shell script. -In this project, write a shell script that when the PI receives a ping command with a specific byte pattern then it must turn on or off an LED. For example, if the ping command’s pattern is “aa ae” then the PI must turn on the LED. If the ping command’s pattern is “ab ae” then the PI must turn off the LED. If the ping command’s pattern is anything else, then the PI should do nothing and only print on the terminal that a PING message was just received.arrow_forward1.8 In a client/ server system, a client transmits a request to a server, the serverperforms a processing operation, and the server returns a result. Describe thepossible things that can go wrong with transmission in this scenario.arrow_forward3. Suppose that you have written a time server, which periodically notifies its clients of the current date and time. Write an interface that the server could use to enforce a particular protocol on its clients.arrow_forward
- Write the code to implements a simple socket server which first accepts an incoming connection and then hands it off to a background thread for reads and writes, hence freeing the main thread to accept the other incoming connections. in Python programming languagearrow_forwardUsing client-server socket programming, implement a multi-threaded server that returns to the client the synonym of a word as stored in a dictionary. The client should prompt the user for a word, reads the word from the screen and sends it to the server and waits for response from the server. Once the client gets the synonym of the word, it should print the word and its synonym on the screen and prompt for another word. This should continue until the user enters the characters @ to quit. Example: >>> python TCPClient.py Input a word: weak weak ==> frail Input a word: fair fair ==> just Input a word: @ Notes: 1) A file that contains some words and their synonyms is provided 2) In the server code, read the file to a global python dictionary object engDict = {} # empty dictionary object with open('dictionary.txt') as f: # open the file for line in f: tok = line.split() engDict[tok[0]] = tok[1] print(engDict) 3) Here is a Skelton of the server [some code here ] class…arrow_forwardUsing client-server socket programming, implement a multi-threaded server that returns to the client the synonym of a word as stored in a dictionary. The client should prompt the user for a word, reads the word from the screen and sends it to the server and waits for response from the server. Once the client gets the synonym of the word, it should print the word and its synonym on the screen and prompt for another word. This should continue until the user enters the characters @ to quit. Example: >>> python TCPClient.py Input a word: weak weak ==> frail Input a word: fair fair ==> just Input a word: @ Notes: 1) A file that contains some words and their synonyms is provided 2) In the server code, read the file to a global python dictionary object engDict = {} # empty dictionary object with open('dictionary.txt') as f: # open the file for line in f: tok = line.split() engDict[tok[0]] = tok[1] print(engDict) 3) Here is a Skelton of the server [some code here ] class…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