Masterset

4.7(3)
studied byStudied by 76 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/135

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

136 Terms

1
New cards

[TCPIP-UNP] Consider TCP socket programming. The following diagram illustrates _____ process.

Server-side

2
New cards

[TCPIP-UNP] Client needs to know Server's IP address and port to be connected. Server's IP address (sin_addr) and port number (sin_port) fields in the Internet socket address structure (sockaddr_in) must be in specific formats. This ____ function converts a binary port number to the proper format (sin_port).

htons

3
New cards

[TCPIP-UNP] Consider client-server model. Which one of the following choices is NOT correct?

There are three main classes of servers: synchronous, iterative, and concurrent.

4
New cards

[TCPIP-UNP] ______ is a computer network diagnostic tool for displaying the route (path) and measuring transit delays of packets across an Internet Protocol (IP) network. The history of the route is recorded as the round-trip times of the packets received from each successive host (remote node) in the route (path); the sum of the mean times in each hop is a measure of the total time spent to establish the connection.

traceroute

5
New cards

[TCPIP-UNP] The following output shows the result of ____ utility. 64 bytes from 93.184.216.119: icmp_seq=0 ttl=56 time=11.632 ms64 bytes from 93.184.216.119: icmp_seq=1 ttl=56 time=11.726 ms64 bytes from 93.184.216.119: icmp_seq=2 ttl=56 time=10.683 ms64 bytes from 93.184.216.119: icmp_seq=3 ttl=56 time=9.674 ms64 bytes from 93.184.216.119: icmp_seq=4 ttl=56 time=11.127 ms

ping

6
New cards

[TCPIP-UNP] Consider the features or advantages of TCP. TCP provides ______ connection over which TCP client establishes with servers and exchanges data. Which one of the following choices is NOT correct?

atomic

7
New cards

[TCPIP-UNP] Client needs to know Server's IP address and port to be connected. Server's IP address (sin_addr) and port number (sin_port) fields in the Internet socket address structure (sockaddr_in) must be in specific formats. This ____ function convert an IP address in ASCII command-line argument (for example, "192.10.16.4") into the proper format (sin_addr).

inet_aton or inet_addr

8
New cards

[TCPIP-UNP] Consider TCP socket programming. Which one of the following choices is NOT correct?

All three transport layers (UDP, SCTP and TCP) use 32-bit integer port numbers.

9
New cards

[TCPIP-UNP] Consider IPv4 and IPv6. Which one of the following choices is NOT correct?

IPv4 uses 16-bit addresses.

10
New cards

[TCPIP-UNP] Consider TCP socket programming. Which one of the following choices is NOT correct?

Server needs to know client's socket prior to connection being requested.

11
New cards

[TCPIP-UNP] _____ is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed. If no arguments are given, it displays the status of the currently active interfaces.

ifconfig

12
New cards

[TCPIP-UNP] Consider TCP. Which one of the following choices is NOT correct?

TCP is a connection-sensitive protocol

13
New cards

[TCPIP-UNP] ____ is a network utility tool that displays the local host's network connections for transmission control protocol ((both incoming and outgoing), routing tables, and a number of network interface and network protocol statistics. It is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement. This command is used to find which TCP port is bound or free so that one may choose a free port for one's server to bind and listen.

netstat

14
New cards

[TCPIP-UNP] The ____ utility was written by Mike Muuss in 1983 as a tool to troubleshoot problems in an IP network. It is inspired by David Mills on using ICMP echo packets for IP network diagnosis and measurements. RFC1122 prescribes that any host must process an ICMP Echo Request and issue an Echo Reply in return.

ping

15
New cards

[APUE11] When a thread is terminated, a thread can arrange for a function to be called when it exits. Which of the following statement is not correct?

The process runs this function for the thread being terminated.

16
New cards

[APUE11] When multiple threads of control share the same memory (a shared variable), one needs to make sure that each thread sees a consistent view of its data. Which of the following statements is not correct? Select one best answer.

While a thread reads a variable, there is no consistency problem.

17
New cards

[APUE11] What is a thread primitive, corresponding to waitpid for process.

pthread_join

18
New cards

[APUE11] Select the description of each thread primitive.

pthread_create
C.
create a new flow of control
pthread_exit
D.
exit from an existing flow of control
pthread_join
B.
get exit status for flow of control
pthread_cleanup_push
F.
register function to be called at exit from flow of control
pthread_self
A.
get ID for flow of control
pthread_cancel
E.
request abnormal termination of flow of control

19
New cards

[APUE11] When the default action initialed by a thread is to terminate the process of this thread, what is expected?

A signal sent to a thread will terminate the entire process.

20
New cards

[APUE11] If any thread within a process calls exit, _Exit, or _exit, then what is expected?

the entire process (with all of its threads) terminates.

21
New cards

[APUE11] Spin locks are useful when running in real-time scheduling class that doesn't allow ____.

preemption

22
New cards

[APUE11] If a thread knows that no thread cares about its return value, then which of the following functions does it call to indicate that resources associated with it can be released on termination?

pthread_detach

23
New cards

[APUE11] Spin locks are often used as low-level primitives to implement other types of locks, and can be implemented efficiently using ___ instruction.

test-and-set

24
New cards

[APUE11] Which of the following functions is used by a thread to terminate itself?

pthread_exit

25
New cards

[APUE11] Consider the following function to be run by a thread.void PrintHello(void threadid) { . . . }pthread_t tid;int rc; Which of the following statement is correct to create a thread that executes a function called PrintHello?

rc = pthread_create(&tid, NULL, PrintHello, (void *)1);

26
New cards

[APUE11] ___ is like a mutex, except that instead of blocking a process by sleeping, the process is blocked by busy-waiting until the lock can be acquired.

spin-lock

27
New cards

[APUE11] Spin locks are useful when used in a(n) ___ kernel: besides providing a mutual exclusion mechanism, they block interrupts so an interrupt handler can't deadlock the system by trying to acquire a spin lock that is already locked.

nonpreemptive

28
New cards

[APUE11] ___ is a synchronization mechanism that can be used to coordinate multiple threads working in parallel. This allows each thread to wait until all cooperating threads have reached the same point, and then continue executing from there.

barrier

29
New cards

[APUE11] A thread can arrange for functions to be called when it exits, similar to the way that the atexit function.

pthread_cleanup_push

30
New cards

[APUE11] Which of the following functions is used by a thread to obtain its ID?

pthread_self

31
New cards

[APUE11.6] With this locking mechanism, the caller passes it locked to the function, which then atomically places the calling thread on the list of threads waiting for the condition and unlocks the mutex. This closes the window between the time that the condition is checked and the time that the thread goes to sleep waiting for the condition to change, so that the thread doesn't miss a change in the condition.

conditional variable

32
New cards

[APUE11.6] One additional mutex primitive allows us to bound the time that a thread blocks when a mutex it is trying to acquire is already locked. The ____ function is equivalent to pthread_mutex_lock, but if the timeout value is reached, it will return the error code ETIMEDOUT without locking the mutex.

pthread_mutex_timedlock

33
New cards

[APUE11.6] When we use more than one mutex in our programs, a(n) ____ can occur if we allow one thread to hold a mutex and block while trying to lock a second mutex at the same time that another thread holding the second mutex tries to lock the first mutex. Neither thread can proceed, because each needs a resource that is held by the other, so we have a(n) ____.

deadlock

34
New cards

[APUE11.6] If we allocate the mutex dynamically (by calling malloc, for example), then we need to call _____ before freeing the memory.

pthread_mutex_destroy

35
New cards

[APUE11.6] While it is set, any other thread that tries to set it will block until we release it. If more than one thread is blocked when we unlock the ____, then all threads blocked on the lock will be made runnable, and the first one to run will be able to set the lock. The others will see that the ____ is still locked and go back to waiting for it to become available again. In this way, only one thread will proceed at a time.

mutex

36
New cards

[APUE11.6] _____ is well suited for situations in which data structures are read more often than they are modified. When a(n) ____ is held in write mode, the data structure it protects can be modified safely, since only one thread at a time can hold the lock in write mode.

reader-writer lock

37
New cards

[APUE11.6] Assume that you have two mutexes, A and B, that you need to lock at the same time. If all threads always lock mutex A before mutex B, ____.

Deadlocks can be avoided with these two mutexes.

38
New cards

[APUE11.6] When multiple threads of control share the same memory, each thread should see a consistent view of its data. Which one of the following statements is NOT correct?

A variable which is read-only could create a consistency problem with more than one thread reading its value at the same time.

39
New cards

[APUE11.6] With multiple threads of control, we can design our programs to do more than one thing at a time within a single process, with each thread handling a separate task. This approach can have several benefits. Which one of the following statements is NOT correct?

A single-threaded process with multiple tasks cannot serializes those tasks.

40
New cards

[APUE11.6] A mutex variable must be first initialized by either setting it to the constant _____ (for statically allocated mutexes only) or calling ____.

PTHREAD_MUTEX_INITIALIZER, pthread_mutex_init

41
New cards

[APUE11.6] ____ is similar to mutex, except that they allow for higher degrees of parallelism. With a mutex, the state is either locked or unlocked, and only one thread can lock it at a time. Three states are possible with this lock: locked in read mode, locked in write mode, and unlocked.

reader-writer lock

42
New cards

[APUE11.6] Although implementations vary, reader-writer locks usually block additional readers if a lock is already held in read mode and a thread is blocked trying to acquire the lock in write mode. This prevents a constant stream of readers from ____ waiting writers.

starving

43
New cards

[APUE11.6] ____ is a synchronization mechanism that can be used to coordinate multiple threads working in parallel. It allows each thread to wait until all cooperating threads have reached the same point, and then continue executing from there.

barrier

44
New cards

[APUE11.6] _____ objects are more general than this, however. They allow an arbitrary number of threads to wait until all of the threads have completed processing, but the threads don't have to exit. They can continue working after all threads have reached the ____.

barrier

45
New cards

[APUE11.6] Just as with mutexes, the Single UNIX Specification provides functions to lock reader-writer locks with a timeout to give applications a way to avoid blocking indefinitely while trying to acquire a reader-writer lock. One of these functions is _____.

pthread_rwlock_timedwrlock

46
New cards

[APUE11.6] Only one thread at a time can hold a(n) ____ in write mode, but multiple threads can hold a(n) ____ in read mode at the same time.

reader-writer lock

47
New cards

[APUE11.6] When a reader-writer lock is ____ locked, all threads attempting to ___ are given access, but all threads attempting to write must wait until the lock is released by all threads in ____.

read

48
New cards

[APUE11.6] To write lock a reader-writer lock, we call ____.

pthread_rwlock_wrlock

49
New cards

[APUE11.6] A typical UNIX _____ can be thought of as having a single thread of control (that is, doing only one thing at a time).

process

50
New cards

[APUE11.6] At user level, ____ is not as useful unless you are running in a real-time scheduling class that doesn't allow preemption. User-level threads running in a time-sharing scheduling class can be descheduled when their time quantum expires or when a thread with a higher scheduling priority becomes runnable. In these cases, if a thread is holding ____, it will be put to sleep and other threads blocked on the lock will continue waiting longer than intended.

spinlock

51
New cards

[APUE11.6] The pthread_join function acts as a ____ to allow one thread to wait until another thread exits.

barrier

52
New cards

[APUE11.6] To lock a reader-writer lock in read mode, we call ____.

pthread_rwlock_rdlock

53
New cards

[APUE15] According to the authors. Consider the use of FIFO for shell commands in pipeline or for multiple-clients and the server. Which one of the following statements is NOT correct?

Multiple client-writers should keep the requests to be more than PIPE_BUF bytes in size.

54
New cards

[APUE15] According to the authors. Consider Message Queue. On Linux, for example, the maximum number of messages is based on the maximum number of queues and the maximum amount of data allowed on the queues. The maximum number of queues, in turn, is based on the amount of ___ installed in the system. Note that the queue maximum byte size limit further limits the maximum size of a message to be placed on a queue. Select the best choice for the fill-in.

RAM Memory

55
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct? Consider Message Queue.

A message queue is a linked list of messages stored within user process.

56
New cards

[APUE15] According to the authors. Consider the popen and pclose functions which will do ____. Which one of the following statements is NOT correct?

fork a parent process and a child process in a pipeline

57
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE?

Pipe is created by calling pipe call with two arguments.

58
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct? Consider the performance of mutex, record lock and semaphore in Linux.

record locking is slower than semaphores

59
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

The Bourne-again shell provides a way to connect processes together as coprocesses.

60
New cards

[APUE15] According to the authors. When one end of a pipe is closed, two rules apply. Which one of the following statements is NOT correct?

One can write to a pipe whose write end has been closed.

61
New cards

[APUE15] According to the authors. Consider the popen call as shown below.
fp = popen(cmdstring, "r");
Which one of the following statements is NOT correct?

The file pointer returned is connected to the standard input of cmdstring

62
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE?

Pipes cannot be used for any full-duplex IPC communication.

63
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE? Consider the following code segment.
int fd[2];
pipe(fd);

The fstat function returns a file type of PIPE for the file descriptor of either end of a pipe.

64
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

FIFOs are sometimes called anonymous pipes.

65
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?

To use a resource with a semaphore, the process increments the semaphore value by 1.

66
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct about PIPE?

Normally the process that calls fork then calls pipe to have IPC between two processes.

67
New cards

[APUE15] According to the authors. When one end of a pipe is closed, two rules apply. Consider the following code segment.
int fd[2];
pipe(fd);
Which one of the following statements is CORRECT?

For a pipe from the child to the parent, the parent closes fd[1], and the child closes fd[0].

68
New cards

[APUE15] According to the authors. Which one of the following statements is NOT correct?Consider a semaphore to control only one resource.

The semaphore value is initialized to 0.

69
New cards

[APUE15] According to the authors. Consider a filter. Which one of the following statements is NOT correct?

A filter becomes a coprocess when it generates the filter's input and reads the filter's output.

70
New cards

[APUE16] Which of the following terms is used to denote units of data being transmitted:

All of the above

71
New cards

[APUE16] Which of the following statements about socket programming (socket descriptor) is not correct?

If the socket descriptor is in blocking mode, the application can use either poll or select to determine when the file descriptor is readable.

72
New cards

[APUE16] Which of the following is an application layer protocol (e.g., in TCP/IP model).

Telnet

73
New cards

[APUE16] The single most important motive for the new IPv6 protocol is:

Address space expansion

74
New cards

[APUE16] Which of the following statements about socket is not correct?

Many of the functions with file descriptors (e.g., read or write) will not work with a socket descriptor.

75
New cards

[APUE16] Which is not a classical method of IPC provided by various UNIX systems.

thread

76
New cards

[APUE16] To write code for port-to-port communication (e.g., TCP/IP), a programmer uses:

The socket application programming interface

77
New cards

[APUE16] Which of the following is common to both TCP and UDP:

Port-to-port communication

78
New cards

[APUE16] In a layered protocol architecture (e.g., TCP/IP), a benefit and rationale for a module at one layer relying on another module at the layer below for some service is:

All of the above

79
New cards

[APUE16] Which of the following statements about socket programming (socket address) is not correct?

The address associated with a client's socket must be known to the server with datagram.

80
New cards

[APUE16] Which of the following statements about socket programming (accept function) is not correct?

accept provides non-blocking socket.

81
New cards

[APUE16] Which of the following statements about socket programming with SOCK_STREAM (TCP) is not correct?

after the connection in place, one can communicate to the other in one direction.

82
New cards

[APUE16] Which of the following statements about socket programming (nonblocking & asynchronous IO) is not correct?

When the socket is in blocking mode, the poll or select functions should be used to send or receive data.

83
New cards

[APUE16] A protocol architecture (e.g., TCP/IP) performs a task by implementing it as:

Separate program modules, responsible for subtasks, that cooperate with each other

84
New cards

[APUE16] Which of the following is part of the syntax of a protocol (e.g., TCP/IP):

Its packet format

85
New cards

[APUE16] Which of the following statements about socket programming (close and shutdown) is NOT correct?

The close function deallocates the network endpoint only when all the active references are closed.

86
New cards

[APUE16] Which of the following is a transport layer protocol (TCP):

UDP

87
New cards

[APUE16] Which of the following statements about socket programming (out-of-band) is not correct?

TCP and UPD support out-of-band data.

88
New cards

[APUE16] As a data unit moves up from one protocol layer to another (e.g., for TCP/IP), control headers are:

Removed

89
New cards

[Cloud] Consider the Cloud Computing as discussed in the class. Amazon has been pioneering and providing one of the most popular cloud computing platforms and services including Amazon Web Services (AWS) and ____. Which one of the following choices is Correct?

Elastic Compute Cloud (EC2).

90
New cards

[Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class. The provider's computing resources are pooled to serve multiple consumers using a multi-tenant model, with different physical and virtual resources dynamically assigned and reassigned according to consumer demand. This is about _____. Select the best answer.

Resource pooling

91
New cards

[Cloud] Consider the Cloud Computing as discussed in the class. Cloud computing is designed to _____. Which one of the following choices is NOT correct?

to support serverless service-framework

92
New cards

[Cloud] Consider the Cloud Computing as discussed in the class.The main enabling technology for cloud computing is _____.Which one of the following choices is Correct?

virtualization

93
New cards

[Cloud] Consider Virtualization as discussed in the class. Which one of the following choices is NOT correct?

By maximizing user involvement, automation speeds up the process, reduces labor costs and reduces the possibility of human errors.

94
New cards

[Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class. A consumer can unilaterally provision computing capabilities, such as server time and network storage, as needed automatically without requiring human interaction with each service provider. This is about _____. Select the best answer.

On-demand self-service

95
New cards

[Cloud] Consider the Cloud Computing as discussed in the class. Which one of the following choices is NOT correct?

It is to make resources available in any cloudy situations.

96
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class. Public-cloud delivery model converts capital expenditures (e.g., buying servers) to operational expenditure. This lowers effectively barriers to entry, as infrastructure is typically provided by a third party and need not be purchased for one-time or infrequent intensive computing tasks. This generates or causes one of the following benefits. Which one of the following choices is Correct?

Cost Reduction

97
New cards

[Cloud] Consider Five Essential Characteristics of Cloud Computing (NIST) as discussed in the class. Capabilities can be elastically provisioned and released, in some cases automatically, to scale rapidly outward and inward commensurate with demand. To the consumer, the capabilities available for provisioning often appear unlimited and can be appropriated in any quantity at any time. This is about _____. Select the best answer.

Rapid elasticity

98
New cards

[Cloud] Consider three models of Cloud Computing (NIST) as discussed in the class. The consumer does not manage or control the underlying cloud infrastructure including network, servers, operating systems, storage, or even individual application capabilities, with the possible exception of limited user-specific application configuration settings. The capability provided to the consumer is to use the provider's applications running on a cloud infrastructure. The applications are accessible from various client devices through either a thin client interface, such as a web browser (e.g., web-based email), or a program interface. This describes one of three models of cloud computing (NIST). Which one of the following choices is correct?

Software as a Service (SaaS)

99
New cards

[Cloud] Consider three models of Cloud Computing (NIST) as discussed in the class.____ refers to online services that provide high-level APIs used to abstract various low-level details of underlying network infrastructureWhich one of the following choices is correct?

Infrastructure as a Service (IaaS)

100
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class. ____ is about sharing of resources and costs with a large pool of users Which one of the following choices is Correct?Select the best answer.

Multitenancy