Question 1
Few modern computers use threads to represent processes.Answers: True
FalseQuestion 2
What two items must be given to the socket function in order to create a socket object?Answers: a.
b.
c. d.Question 3
The release() method of the Condition class relinquishes the lock, leaving it to be acquired by others.Answers:
TrueFalseQuestion 4
When developing a network application, the programmer can first try it out on a local host—that is, on a standalone computer that may or may not be connected to the Internet.Answers:
TrueFalseQuestion 5
What thread method can be used to test if the thread is dead or not?Answers: a.b.
c. d.Question 6
You have just captured data using the socket.recv method into a variable named client_data. What can you use to convert client_data to a string?Answers: a.b.
c. d.Question 7
Which of the following is an example of time slicing?Answers: a.b.
c. d.Question 8
A thread that is waiting for user input is most likely in what state?Answers: a.b.c.
d. Question 9
The procedure by which a process's state is saved before being swapped out of the CPU, then us restored to the state when the process is about to execute, is known as?Answers:
a. b.c.d.Question 10
A socket is bound to an address (host, port) by running its bind method.Answers:
TrueFalseQuestion 11
A program starting another program or a new process is known by what term?Answers: a.b.c.
d. Question 12
In order to execute code in a thread as a process, what must be done?Answers: a.b.
c. d.Question 13
What does the socket module function gethostname() do?Answers: a.b.c.
d. Question 14
Because an IDLE itself runs in a thread, it is not generally a good idea to test a multithreaded application in that environment.Answers:
TrueFalseQuestion 15
A port serves as a channel through which several clients can exchange data with the same server or with different servers.Answers:
TrueFalseQuestion 16
Time-sharing systems are still in widespread use in the form of Web servers, e-mail servers, print servers, and other kinds of servers on networked systems.Answers:
TrueFalseQuestion 17
Producer/consumer threads can suffer from synchronization problems.Answers:
TrueFalseQuestion 18
What is the socket bind method used for?Answers: a.b.c.
d. Question 19
In the event that a thread loses access to the CPU, such as via a time-out, sleep, block, or wait state, what happens when the thread is ready to resume execution?Answers:
a. b.c.d.Question 20
After using the socket.recv method, what type of data is returned?Answers:
a. b.c.d.Question 21
What kind of problem occurs in a producer/consumer relationship in which the consumer attempts to access data that are not there, or accesses the same data more than once?Answers: a.
b. c.d.Question 22
What two thread condition methods can be used to release a lock? (Choose two.)Answers:
a.
b. c.d.Question 23
The discipline of building hardware architectures, operating systems, and specialized algorithms for running a program on a cluster of processors is known by what term?Answers:
a. b.c.d.Question 24
You cannot create and open several sockets on the same port of a host computer.Answers: True
FalseQuestion 25
The most common way to create a thread is to define a class that extends the class threading.Runnable.Answers: True
False
0 comments:
Post a Comment