Midterm 1

Ace your homework & exams now with Quizwiz!

A parent process calling _____ system call will be suspended until children processes terminate. a) wait b) fork c) exit d) exec

A

When the process issues an I/O request : a) It is placed in an I/O queue b) It is placed in a waiting queue c) It is placed in the ready queue d) It is placed in the Job queue

A

Which of the following state transitions is not possible? a) blocked to running b) ready to running c) blocked to ready d) running to blocked

A

What is the ready state of a process? a) when process is scheduled to run after some execution b) when process is unable to run until some task has been completed c) when process is using the CPU d) none of the mentioned

A Explanation: When process is unable to run until some task has been completed, the process is in blocked state and if process is using the CPU, it is in running state.

A process may transition to the Ready state by which of the following actions?

A) Completion of an I/O event B) Awaiting its turn on the CPU C) Newly-admitted process **D) All of the above

The _______ process is assigned as the parent to orphan processes. A) zombie B) init C) main D) renderer

B

Which of the following need not necessarily be saved on a context switch between processes? a) General purpose registers b) Translation look-aside buffer c) Program counter d) All of these

B

If all processes I/O bound, the ready queue will almost always be ______, and the Short term Scheduler will have a ______ to do. a) full,little b) full,lot c) empty,little d) empty,lot

C

A _________________ saves the state of the currently running process and restores the state of the next process to run.

Context switch

The ________ application is the application appearing on the display screen of a mobile device. A) main B) background C) display D) foreground

D

The state of a process is defined by : a) the final activity of the process b) the activity just executed by the process c) the activity to next be executed by the process d) the current activity of the process

D

T/F All access to POSIX shared memory requires a system call.

Fasle

Name and describe the different states that a process can exist in at any given time.

The possible states of a process are: new, running, waiting, ready, and terminated. The process is created while in the new state. In the running or waiting state, the process is executing or waiting for an event to occur, respectively. The ready state occurs when the process is ready and waiting to be assigned to a processor and should not be confused with the waiting state mentioned earlier. After the process is finished executing its code, it enters the termination state.

Explain the main differences between a short-term and long-term scheduler.

The primary distinction between the two schedulers lies in the frequency of execution. The short-term scheduler is designed to frequently select a new process for the CPU, at least once every 100 milliseconds. Because of the short time between executions, the short-term scheduler must be fast. The long-term scheduler executes much less frequently; minutes may separate the creation of one new process and the next. The long-term scheduler controls the degree of multiprogramming. Because of the longer interval between executions, the long-term scheduler can afford to take more time to decide which process should be selected for execution.

T/F Named pipes continue to exist in the system after the creating process has terminated.

True

T/F Ordinary pipes in UNIX require a parent-child relationship between the communicating processes.

True

T/F Ordinary pipes in Windows require a parent-child relationship between the communicating processes.

True

A process that has terminated, but whose parent has not yet called wait(), is known as a ________ process. A) zombie B) orphan C) terminated D) init

A

A set of processes is deadlock if a) each process is blocked and will remain so forever b) each process is terminated c) all processes are trying to kill each other d) none of the mentioned

A

A single thread of control allows the process to perform : a) only one task at a time b) multiple tasks at a time c) All of these

A

Cascading termination refers to termination of all child processes before the parent terminates ______. a) Normally b) Abnormally c) Normally or abnormally d) None of these

A

If a process is executing in its critical section, then no other processes can be executing in their critical section. This condition is called a) mutual exclusion b) critical exclusion c) synchronous exclusion d) asynchronous exclusion

A

In Unix, Which system call creates the new process? a) fork b) create c) new d) none of the mentioned

A

The only state transition that is initiated by the user process itself is : a) block b) wakeup c) dispatch d) None of these

A

To enable a process to wait within the monitor, a) a condition variable must be declared as condition b) condition variables must be used as Boolean objects c) semaphore must be used d) all of the mentioned

A

What is a long-term scheduler? a) It selects which process has to be brought into the ready queue b) It selects which process has to be executed next and allocates CPU c) It selects which process to remove from memory by swapping d) None of these

A

When high priority task is indirectly preempted by medium priority task effectively inverting the relative priority of the two tasks, the scenario is called a) priority inversion b) priority removal c) priority exchange d) priority modification

A

Which of the following is true in a Mach operating system? A) All messages have the same priority. B) Multiple messages from the same sender are guaranteed an absolute ordering. C) The sending thread must return immediately if a mailbox is full. D) It is not designed for distributed systems.

A

Which of the following statements is true? A) Shared memory is typically faster than message passing. B) Message passing is typically faster than shared memory. C) Message passing is most useful for exchanging large amounts of data. D) Shared memory is far more common in operating systems than message passing.

A

Which process can be affected by other processes executing in the system? a) cooperating process b) child process c) parent process d) init process

A

Which system call returns the process identifier of a terminated child? a) wait b) exit c) fork d) get

A

The child process can : (choose two) a) be a duplicate of the parent process b) never be a duplicate of the parent process c) have another program loaded into it d) never have another program loaded into it

A & C

When a process terminates : (Choose Two) a) It is removed from all queues b) It is removed from all, but the job queue c) Its process control block is de-allocated d) Its process control block is never de-allocated

A & C

The objective of multi-programming is to : (choose two) a) Have some process running at all times b) Have multiple programs waiting in a queue ready to run c) To minimize CPU utilization d) To maximize CPU utilization

A & D

What is a loopback and when is it used?

A loopback is a special IP address: 127.0.0.1. When a computer refers to IP address 127.0.0.1, it is referring to itself. When using sockets for client/server communication, this mechanism allows a client and server on the same host to communicate using the TCP/IP protocol.

T/F A socket is identified by an IP address concatenated with a port number.

True

T/F All processes in UNIX first translate to a zombie process upon termination.

True

T/F For a single-processor system, there will never be more than one process in the Running state.

True

T/F Local Procedure Calls in Windows XP are similar to Remote Procedure Calls.

True

T/F The Mach operating system treats system calls with message passing.

True

T/F The iOS mobile operating system only supports a limited form of multitasking.

True

T/F Using a section object to pass messages over a connection port avoids data copying.

True

Explain the concept of a context switch.

Whenever the CPU starts executing a new process, the old process's state must be preserved. The context of a process is represented by its process control block. Switching the CPU to another process requires performing a state save of the current process and a state restore of a different process. This task is known as a context switch. When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saves context of the new process scheduled to run.

A(n) ______________ allows several unrelated processes to use the pipe for communication.

Anonymous pipe

Child processes inherit UNIX ordinary pipes from their parent process because: A) The pipe is part of the code and children inherit code from their parents. B) A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents. C) The STARTUPINFO structure establishes this sharing. D) All IPC facilities are shared between the parent and child processes.

B

In a time-sharing operating system, when the time slot given to a process is completed, the process goes from the running state to the : a) Blocked state b) Ready state c) Suspended state d) Terminated state

B

Suppose that a process is in "Blocked" state waiting for some I/O service. When the service is completed, it goes to the : a) Running state b) Ready state c) Suspended state d) Terminated state

B

The Process Control Block is : a) Process type variable b) Data Structure c) a secondary storage section d) a Block in memory

B

The address of the next instruction to be executed by the current process is provided by the a) CPU registers b) program counter c) process stack d) pipe

B

The child process completes execution, but the parent keeps executing, then the child process is known as: a) Orphan b) Zombie c) Body d) Dead

B

The number of processes completed per unit time is known as __________. a) Output b) Throughput c) Efficiency d) Capacity

B

What is a short-term scheduler? a) It selects which process has to be brought into the ready queue b) It selects which process has to be executed next and allocates CPU c) It selects which process to remove from memory by swapping d) None of these

B

What is interprocess communication? a) Communication within the process b) communication between two process c) communication between two threads of same process d) none of the mentioned

B

When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called a) dynamic condition b) race condition c) essential condition d) critical condition

B

Which of the following do not belong to queues for processes? a) Job Queue b) PCB queue c) Device Queue d) Ready Queue

B

Which of the following is not the state of a process ? a) New b) Old c) Waiting d) Running e) Ready f) Terminated

B

Explain the terms "at most once" and "exactly once" and indicate how they relate to remote procedure calls.

Because a remote procedure call can fail in any number of ways, it is important to be able to handle such errors in the messaging system. The term "at most once" refers to ensuring that the server processes a particular message sent by the client only once and not multiple times. This is implemented by merely checking the timestamp of the message. The term "exactly once" refers to making sure that the message is executed on the server once and only once so that there is a guarantee that the server received and processed the message.

Ordinarily the exec() system call follows the fork(). Explain what would happen if a programmer were to inadvertently place the call to exec() before the call to fork().

Because exec() overwrites the process, we would never reach the call to fork() and hence, no new processes would be created. Rather, the program specified in the parameter to exec() would be run instead.

Imagine that a host with IP address 150.55.66.77 wishes to download a file from the web server at IP address 202.28.15.123. Select a valid socket pair for a connection between this pair of hosts. A) 150.55.66.77:80 and 202.28.15.123:80 B) 150.55.66.77:150 and 202.28.15.123:80 C) 150.55.66.77:2000 and 202.28.15.123:80 D) 150.55.66.77:80 and 202.28.15.123:3500

C

In UNIX, each process is identified by its : a) Process Control Block b) Device Queue c) Process Identifier d) None of these

C

In UNIX, the return value for the fork system call is _____ for the child process and _____ for the parent process. a) A Negative integer, Zero b) Zero, A Negative integer c) Zero, A nonzero integer d) A nonzero integer, Zero

C

In a multi-programming environment : a) the processor executes more than one process at a time b) the programs are developed by more than one person c) more than one process resides in the memory d) a single user can execute many programs at the same time

C

Mutual exclusion can be provided by the a) mutex locks b) binary semaphores c) both (a) and (b) d) none of the mentioned

C

Process synchronization can be done on a) hardware level b) software level c) both (a) and (b) d) none of the mentioned

C

Restricting the child process to a subset of the parent's resources prevents any process from : a) overloading the system by using a lot of secondary storage b) under-loading the system by very less CPU utilization c) overloading the system by creating a lot of sub-processes d) crashing the system by utilizing multiple resources

C

Several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called a(n) ____. a) Shared Memory Segments b) Entry Section c) Race condition d) Process Synchronization

C

The entry of all the PCBs of the current processes is in : a) Process Register b) Program Counter c) Process Table d) Process Unit

C

The primary distinction between the short term scheduler and the long term scheduler is: a) The length of their queues b) The type of processes they schedule c) The frequency of their execution d) None of these

C

What is a medium-term scheduler? a) It selects which process has to be brought into the ready queue b) It selects which process has to be executed next and allocates CPU c) It selects which process to remove from memory by swapping d) None of these

C

Which of the following does not interrupt a running process? a) A device b) Timer c) Scheduler process d) Power failure

C

Which of the following is not a process type in the Chrome browser? A) Plug-in B) Renderer C) Sandbox D) Browser

C

Which of the following statements is true? A) Named pipes do not allow bi-directional communication. B) Only the parent and child processes can use named pipes for communication. C) Reading and writing to ordinary pipes on both UNIX and Windows systems can be performed like ordinary file I/O. D) Named pipes can only be used by communicating processes on the same machine.

C`

Name the three types of sockets used in Java and the classes that implement them.

Connection-oriented (TCP) sockets are implemented with the Socket class. Connectionless (UDP) sockets use the DatagramSocket class. Finally, the MulticastSocket class is a subclass of the DatagramSocket class. A multicast socket allows data to be sent to multiple recipients.

A monitor is a module that encapsulates a) shared data structures b) procedures that operate on shared data structure c) synchronization between concurrent procedure invocation d) all of the mentioned

D

A process can be terminated due to a) normal exit b) fatal error c) killed by another process d) all of the mentioned

D

A process stack does not contain a) function parameters b) local variables c) return addresses d) PID of child process

D

In operating system, each process has its own a) address space and global variables b) open files c) pending alarms, signals and signal handlers d) all of the mentioned

D

The context of a process in the PCB of a process does not contain: a) the value of the CPU registers b) the process state c) memory-management information d) context switch time

D

The degree of multi-programming is : a) the number of processes executed per unit time b) the number of processes in the ready queue c) the number of processes in the I/O queue d) the number of processes in memory

D

When communicating with sockets, a client process initiates a request for a connection and is assigned a port by the host computer. Which of the following would be a valid port assignment for the host computer? A) 21 B) 23 C) 80 D) 1625

D

With ................ only one process can execute at a time; meanwhile all other process are waiting for the processor. With .............. more than one process can be running simultaneously each on a different processor. a) Multiprocessing, Multiprogramming b) Multiprogramming, Uniprocessing c) Multiprogramming, Multiprocessing d) Uniprogramming, Multiprocessing

D

Explain the purpose of external data representation (XDR).

Data can be represented differently on different machine architectures (e.g., little-endian vs. big-endian). XDR represents data independently of machine architecture. XDR is used when transmitting data between different machines using an RPC.

Explain the fundamental differences between the UNIX fork() and Windows CreateProcess() functions.

Each function is used to create a child process. However, fork() has no parameters; CreateProcess() has ten. Furthermore, whereas the child process created with fork() inherits a copy of the address space of its parent, the CreateProcess() function requires specifying the address space of the child process.

Explain why Google Chrome uses multiple processes.

Each website opens up in a separate tab and is represented with a separate renderer process. If that webpage were to crash, only the process representing that the tab would be affected, all other sites (represented as separate tabs/processes) would be unaffected.

T/F A new browser process is create by the Chrome browser for every new website that is visited.

False

T/F Sockets are considered a high-level communications scheme.

False

T/F The difference between a program and a process is that a program is an active entity while a process is a passive entity.

False

T/F The exec() system call creates a new process.

False

T/F Shared memory is a more appropriate IPC mechanism than message passing for distributed systems.

Fasle

Describe two approaches to the binding of client and server ports during RPC calls.

First, the binding information may be predetermined, in the form of fixed port addresses. At compile time, an RPC call has a fixed port number associated with it. Second, binding can be done dynamically by a rendezvous mechanism. Typically, an operating system provides a rendezvous daemon on a fixed RPC port. A client then sends a message containing the name of the RPC to the rendezvous daemon requesting the port address of the RPC it needs to execute. The port number is returned, and the RPC calls can be sent to that port until the process terminates (or the server crashes).

A Process Control Block(PCB) does not contain which of the following : a) Code b) Stack c) Heap d) Data e) Program Counter f) Process State g) I/O status information h) bootstrap program

H

Describe how UNIX and Linux manage orphan processes.

If a parent terminates without first calling wait(), its children are considered orphan processes. Linux and UNIX assign the init process as the new parent of orphan processes and init periodically calls wait() which allows any resources allocated to terminated processes to be reclaimed by the operating system.

The systems which allows only one process execution at a time, are called a) uniprogramming systems b) uniprocessing systems c) unitasking systems d) none of the mentioned

a Explanation: Those systems which allows more than one process execution at a time, are called multiprogramming systems. Uniprocessing means only one processor.

The list of processes waiting for a particular I/O device is called a(n) ____.

device queue

A blocking send() and blocking receive() is known as a(n) _________________

rendezvous

In a(n) ____ temporary queue, the sender must always block until the recipient receives the message.

zero capacity

When do you switch a process?

• Clock interrupt - process has executed for the maximum allowable time slice • I/O interrupt • Memory fault - memory address is in virtual memory so it must be brought into main memory • Trap - error occurred - may cause process to be moved to Exit state • Supervisor call - such as file open

Explain the term marshalling.

Marshalling involves the packaging of parameters into a form that can be transmitted over the network. When the client invokes a remote procedure, the RPC system calls the appropriate stub, passing it the parameters provided to the remote procedure. This stub locates the port on the server and marshals the parameters. If necessary, return values are passed back to the client using the same technique.

The _____ refers to the number of processes in memory

The child process runs concurrently with the parent. B) The child process has a new program loaded into it. C) The child is a duplicate of the parent. **D) All of the above

Explain the difference between an I/O-bound process and a CPU-bound process.

The differences between the two types of processes stem from the number of I/O requests that the process generates. An I/O-bound process spends more of its time seeking I/O operations than doing computational work. The CPU-bound process infrequently requests I/O operations and spends more of its time performing computational work.


Related study sets

CompTIA Linux+ Ch. 5 Review Questions

View Set

ASTRO RadBio 2017-XXXX Qs - DNA Repair Mechanisms

View Set

Rocketry History (It's me, guys)

View Set

AMNH genetic and genomic in nursing

View Set

Vocabulary Definitions: "All Summer in a Day" by Ray Bradbury

View Set

HUN2202 Nutrition Ch 12 Water and the Major Minerals

View Set

Chapter 13: Implementing Basic Differences Tests

View Set