Deck 15: Multithreading, Networks, Clientserver Programming
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/47
Play
Full screen (f)
Deck 15: Multithreading, Networks, Clientserver Programming
1
The problems of running and scheduling processes are more complex on a networked system.
True
2
In Java, a thread is an object in that it can hold data, receive messages, be stored in data structures, and be passed as parameters to methods. ____________________
True
3
____ computing is the discipline of building hardware architectures, operating systems, and specialized algorithms for running a program on a cluster of processors.
A) Multiprocessor
B) Multithreading
C) Synchronized
D) Parallel
A) Multiprocessor
B) Multithreading
C) Synchronized
D) Parallel
D
4
All of these facts describe multiprocessing systems EXCEPT ____.
A) An example is the Macintosh Multifinder
B) Involves running a single program on several CPUs at once
C) A related development was the ability of a program to start another program
D) The concept of a single user running several programs at once was extended to desktop microcomputers in the late 1980s
A) An example is the Macintosh Multifinder
B) Involves running a single program on several CPUs at once
C) A related development was the ability of a program to start another program
D) The concept of a single user running several programs at once was extended to desktop microcomputers in the late 1980s
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
5
Threads that interact by sharing data are said to have a producer/consumer relationship.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
6
The methods wait and notify, respectively, suspend and resume the execution of the calling thread.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
7
FIGURE 15-1 
Figure 15-1 above shows stages in the life of a(n) ____.
A) parameter
B) thread
C) process
D) socket

Figure 15-1 above shows stages in the life of a(n) ____.
A) parameter
B) thread
C) process
D) socket
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
8
All of these facts describe time-sharing systems EXCEPT ____.
A) Were developed in the late 1980s
B) Allowed several programs to run concurrently on a single computer
C) Users logged in to the computer via a remote terminal.
D) Still used today in the form of Web and e-mail servers
A) Were developed in the late 1980s
B) Allowed several programs to run concurrently on a single computer
C) Users logged in to the computer via a remote terminal.
D) Still used today in the form of Web and e-mail servers
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
9
The code in a shared method runs as an indivisible unit. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
10
In a two-way chat program, there are two distinct Java application programs, one for the client and one for the server.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
11
Sleeping threads wake up in the order in which they were started.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
12
In addition to holding data, the active cell must be in one of two states: writable or not writable. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
13
When a thread's run method had executed its last instruction, the thread dies as an object.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
14
In a two-way chat, the client connects to the server, and the two programs engage in communication until one of them, usually the server, chooses to quit.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
15
Client and server threads can run concurrently on a single computer or be distributed across several computers that are linked in a network.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
16
Every computer on a network has a unique identifier called an IP address.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
17
Context switch is the process of saving or restoring a thread's state. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
18
The CPU is an example of a data structure.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
19
After it is created, a thread remains inactive until someone runs its run method. ____________________
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
20
____ is the ability of a program to start another program by creating a new process.
A) Multithreading
B) Multiprocessing
C) Forking
D) Context switching
A) Multithreading
B) Multiprocessing
C) Forking
D) Context switching
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
21
FIGURE 15-2 
In a program such as the day/time program, the ____ is responsible for establishing an input stream on the connection
A) client
B) server
C) port
D) socket

In a program such as the day/time program, the ____ is responsible for establishing an input stream on the connection
A) client
B) server
C) port
D) socket
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
22
A(n) ____________________ is an object on which a process can obtain a lock.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
23
In a producer/consumer relationship, all of the following are true EXCEPT ____.
A) A producer must produce each item before a consumer consumes it
B) The producer can produce a new item before the consumer consumes the previous item
C) A consumer must consume each item just once
D) All of the above are true
A) A producer must produce each item before a consumer consumes it
B) The producer can produce a new item before the consumer consumes the previous item
C) A consumer must consume each item just once
D) All of the above are true
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
24
FIGURE 15-2 
In a program such as the day/time program, the ____ is responsible for informing the user that it has started.
A) client
B) server
C) port
D) socket

In a program such as the day/time program, the ____ is responsible for informing the user that it has started.
A) client
B) server
C) port
D) socket
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
25
A(n) ____ is a thread that listens indefinitely for client requests, but does not handle them directly.
A) socket
B) port
C) server daemon
D) monitor
A) socket
B) port
C) server daemon
D) monitor
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
26
The term ____________________ refers to processes that can run concurrently to solve a problem.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ____ is an object that establishes a communication link between two ports.
A) IP number
B) monitor
C) channel
D) socket
A) IP number
B) monitor
C) channel
D) socket
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
28
IP stands for ____.
A) Internet Protocol
B) Internal Protocol
C) Internet Process
D) Internal Process
A) Internet Protocol
B) Internal Protocol
C) Internet Process
D) Internal Process
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
29
FIGURE 15-2 
In a program such as the day/time program, the ____ is responsible for establishing an output stream on the connection.
A) client
B) server
C) port
D) socket

In a program such as the day/time program, the ____ is responsible for establishing an output stream on the connection.
A) client
B) server
C) port
D) socket
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
30
FIGURE 15-1 
A(n) ____ is a data structure that enforces first-come, first-served access to a single resource.
A) queue
B) CPU
C) set
D) collection

A(n) ____ is a data structure that enforces first-come, first-served access to a single resource.
A) queue
B) CPU
C) set
D) collection
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
31
FIGURE 15-2 
Jody knows that a(n) ____ loop creates problems such as the ability to handle only one client at a time.
A) nested
B) while (true)
C) enhanced for
D) if (then)

Jody knows that a(n) ____ loop creates problems such as the ability to handle only one client at a time.
A) nested
B) while (true)
C) enhanced for
D) if (then)
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
32
While the cell is writable, the caller of ____ must wait or suspend activity until the producer writes a datum.
A) SharedCell
B) setData
C) getData
D) currentThread
A) SharedCell
B) setData
C) getData
D) currentThread
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
33
The queue containing threads that can be executed is called the ____________________ queue.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
34
FIGURE 15-2 
In Figure 15-2 above, the ____ is usually specified by a number, such as 13 for the day/time server.
A) client program
B) server program
C) socket
D) port

In Figure 15-2 above, the ____ is usually specified by a number, such as 13 for the day/time server.
A) client program
B) server program
C) socket
D) port
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
35
When a thread is waiting for some event, such as user input, to occur, it is in ____ mode.
A) sleep
B) wait
C) switch
D) block
A) sleep
B) wait
C) switch
D) block
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
36
A(n) ____ repeatedly reads an integer from the cell, until it reaches an upper bound.
A) producer
B) socket
C) client handler
D) consumer
A) producer
B) socket
C) client handler
D) consumer
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
37
Time ____ is the process of automatically timing out.
A) crunching
B) ending
C) slicing
D) threading
A) crunching
B) ending
C) slicing
D) threading
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
38
In Esteban's program, the ____ method constructs a new thread.
A) Thread( )
B) boolean isAlive( )
C) void run( )
D) static void yield( )
A) Thread( )
B) boolean isAlive( )
C) void run( )
D) static void yield( )
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ repeatedly writes an integer to the cell and increments the integer, until it reaches an upper bound.
A) producer
B) socket
C) client handler
D) consumer
A) producer
B) socket
C) client handler
D) consumer
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
40
While the cell is not writable, the caller of ____ must wait or suspend activity until the consumer reads a datum.
A) SharedCell
B) setData
C) getData
D) currentThread
A) SharedCell
B) setData
C) getData
D) currentThread
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
41
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
An example is when a word processor creates a process to print a document in the background.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
An example is when a word processor creates a process to print a document in the background.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
42
A(n) ____________________ serves as a channel through which several clients can exchange data with the same server or different servers.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
43
A(n) ____________________ prevents another process from accessing data in the monitor until a condition becomes true.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
44
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
A thread can be put to ____ for a given number of milliseconds.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
A thread can be put to ____ for a given number of milliseconds.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
45
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
These types of problems include when the consumer attempts to access either data that isn't there or the same data twice.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
These types of problems include when the consumer attempts to access either data that isn't there or the same data twice.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
46
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
When a ____ is notified that an event has occurred, it goes to the rear of the ready queue.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
When a ____ is notified that an event has occurred, it goes to the rear of the ready queue.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck
47
Identify the letter of the choice that best matches the phrase or definition.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
Using multiple processes in a program.
a.Multithreading
b.Sleep
c.Blocked thread
d.Multiprocessing
e.Synchronization
Using multiple processes in a program.
Unlock Deck
Unlock for access to all 47 flashcards in this deck.
Unlock Deck
k this deck