UNIX FINAL

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/145

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.

146 Terms

1
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

2
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.

3
New cards

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

IPv4 uses 16-bit addresses.

4
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.

5
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

6
New cards

___ 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

7
New cards

With this locking mechanism, there are two functions to notify threads that a condition has been satisfied. The ____ function will wake up at least one thread waiting on a condition, whereas the ____ function will wake up all threads waiting on a condition.

pthread_cond_signal, pthread_cond_broadcast

8
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

9
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?

Asynchronous programming model is much simpler than Synchronous one.

10
New cards

[APUE11.6] _____ is called shared-exclusive lock. When it is read locked, it is said to be locked in shared mode. When it is write locked, it is said to be locked in exclusive mode.

reader-writer lock

11
New cards

[APUE11.6] ____ is often used as low-level primitives to implement other types of locks. Depending on the system architecture, they can be implemented efficiently using test-and-set instructions.

spinlock

12
New cards

[APUE11.6] ____ is useful when used in a nonpreemptive 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 (think of interrupts as another type of preemption). In these types of kernels, interrupt handlers can't sleep, so the only synchronization primitives they can use are ____.

spinlock

13
New cards

[APUE11.6] The _____ mechanism works only if we design our threads to follow the same data-access rules. The operating system doesn't serialize access to data for us. If we allow one thread to access a shared resource without first acquiring a lock, then inconsistencies can occur even though the rest of our threads do acquire the lock before attempting to access the shared resource.

mutual-exclusion

14
New cards

[APUE11.6] When a reader-writer lock is ____ locked, only one thread to ____ can have it while all threads attempting to read must wait until it is unlocked.

write

15
New cards

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

UDP

16
New cards

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

TCP and UDP support out-of-band data.

17
New cards

[APUE16] ___ allows processes running on different computers (connected to a common network) to communicate with one another.

socket

18
New cards

[APUE16] Which of the following is an application layer program designed to run on top of TCP:

All of the above

19
New cards

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

All of the above

20
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

21
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.

22
New cards

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

accept provides non-blocking socket.

23
New cards

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

The socket application programming interface

24
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.

25
New cards

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.

26
New cards

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

The pclose function terminates the child process

27
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

28
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

29
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.

30
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class. ____ is about flexibility for users with re-provisioning, adding, or expanding technological infrastructure resources. Which one of the following choices is correct? Select the best answer.

Organizational Agility

31
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).

32
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 _____.

Resource pooling

33
New cards

[Cloud] Consider the major benefits of Cloud Computing as discussed in the class.Pricing on a utility computing basis can be simplified or "fine-grained" with usage-based billing options. Cloud computing get the job done for users with less in-house IT skills than needed normally.This generates or causes one of the following benefits.Which one of the following choices is Correct? Select the best answer.

Cost Reduction

34
New cards

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

35
New cards

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);

36
New cards

What is a thread primitive, corresponding to waitpid for process?

pthread_join

37
New cards

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

pthread_self

38
New cards

Which of the following functions is used to create a thread?

pthread_create

39
New cards

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

the entire process (with all of its threads) terminates

40
New cards

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.

41
New cards

We can protect our data and ensure access by only one thread at a time by using the pthreads mutual-exclusion interfaces. A(n) ____ is basically a lock that we set (lock) before accessing a shared resource and release (unlock) when we're done.

mutex

42
New cards

While it is set, any other thread that tries to set it will block until we release the ____. 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.

mutex

43
New cards

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

44
New cards

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

process

45
New cards

___ 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

46
New cards

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.

47
New cards

To write lock a reader-writer lock, we call

pthread_rwlock_wrlock

48
New cards

To initialize a mutex with the default attributes, we set attr to NULL. To lock a mutex, we call ____. If the mutex is already locked, the calling thread will block until the mutex is unlocked. To unlock a mutex, we call ____.

pthread_mutex_lock, pthread_mutex_unlock

49
New cards

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

barrier

50
New cards

The condition is the state of the work queue... (summary: describes signaling in a while loop after mutex unlock)

conditional variable

51
New cards

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

52
New cards

_____ is well suited for situations in which data structures are read more often than they are modified...

reader-writer lock

53
New cards

At user level, ____ is not as useful unless you are running in a real-time scheduling class...

spinlock

54
New cards

Which of the following statements about socket programming (address byte ordering) is not correct?

For a 32-bit integer with the value 0x04030201, the most significant byte is 0x01, and the least significant byte is 0x04 for little-endian byte order.

55
New cards

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.

56
New cards

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

Port-to-port communication

57
New cards

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

Removed

58
New cards

___ 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

59
New cards

[TCPIP-UNP] Consider TCP socket programming. The following diagram illustrates _____ process.Diagram:socket()|\/bind()|\/listen()|\/accept()|\/blocks until connection

Server-side

60
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

61
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.

62
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

63
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

64
New cards

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.

65
New cards

Which of the following statements about socket programming with datagram is not correct?

Datagram provides a connection-oriented service.

66
New cards

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

an application can shut a socket down for writing while still allowing to receive data sent by the process.

67
New cards

Which of the following statements about socket programming is not correct?

Applications with their own customized protocol headers cannot bypass the transport protocols (TCP and UDP, for example).

68
New cards

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

69
New cards

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

70
New cards

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

All of the above

71
New cards

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

Telnet

72
New cards

A service provided by TCP is:

Flow control

73
New cards

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

Address space expansion

74
New cards

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

The socket application programming interface

75
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.

76
New cards

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.

77
New cards

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].

78
New cards

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

pipe is created by calling pipe with two arguments.

79
New cards

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

80
New cards

According to the authors. Which one of the following statements is CORRECT?When a process is done with a shared resource that is controlled by a semaphore, the semaphore ______.

value is incremented by 1

81
New cards

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

The returned file pointer is readable if type is "w"

82
New cards

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

83
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

84
New cards

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

Answer: FIFOs are sometimes called anonymous pipes.

85
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?

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

86
New cards

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

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

87
New cards

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

Answer: All Linux systems now provide full-duplex pipes.

88
New cards

[Cloud]Consider Five Essential Characteristics of Cloud Computing (NIST).A consumer can unilaterally provision computing capabilities without requiring human interaction with each service provider.

Answer: On-demand self-service

89
New cards

Capabilities can be elastically provisioned and released to scale rapidly.

Rapid elasticity

90
New cards

Capabilities are available over the network and accessed through standard mechanisms that promote use by heterogeneous thin or thick client platforms (e.g., mobile phones, tablets, laptops, and workstations). This is about _____.

Broad network access

91
New cards

The main enabling technology for cloud computing is _____.

virtualization

92
New cards

Critical computing resources provided by the provider can be accessed from anywhere.

Easier Maintenance

93
New cards

______ Model applies to any distributed application with service providers and service requestors.

Client-Server

94
New cards

The capability provided is to use the provider's applications; no control over infrastructure.

Software as a Service (SaaS)

95
New cards

Users can access systems via a web browser regardless of location or device.

Global Services

96
New cards

Which of the following service models is NOT correct?

Application as a Service (AaaS)

97
New cards

Which of the following essential characteristics is NOT correct?

Telemarketing service

98
New cards

Cloud computing is designed to ____. Which one is NOT correct?

to explore and share the in-house IT expertise in cloud computing.

99
New cards

Which of the following is NOT correct about cloud computing

It is to make resources available in any cloudy situations.

100
New cards

Public-cloud delivery converts capital expenses into operational expenses.

Cost Reduction