Process Management Flashcards

1
Q

The ____ of a process contains temporary data such as function parameters, return addresses, and local variables.

a. text section
b. data section
c. program counter
d. stack

A

D- STACK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When a child process is created, which of the following is a possibility in terms of the execution or address space of the child process?

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

A

D- ALL OF THE ABOVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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

a. save-and-restore
b. state switch
c. context switch
d. none of the above

A

C- CONTEXT SWITCH

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A

D- ALL OF THE ABOVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

a. synchronized message
b. rendezvous
c. blocked message
d. asynchronous message

A

B- RENDEZVOUS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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

a. named pipe
b. anonymous pipe
c. LIFO
d. ordinary pipe

A

A- NAMED PIPE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

C

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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.

A

B- A PIPE IS TREATED AS A FILE DESCRIPTOR AND CHILD PROCESSES INHERIT OPEN FILE DESCRIPTORS FROM THEIR PARENTS

When a child process is created using the fork() system call, the child process is an exact copy of the parent process, including open file descriptors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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- ZOMBIE
it is a process that has finished its task but is still being tracked by the operating system.

When a process completes its execution, it typically sends a termination status to its parent process and exits. The parent process is responsible for collecting this status information using system calls like wait() or waitpid(). Until the parent process collects this information, the child process remains in a zombie state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The _______ process is assigned as the parent to orphan processes.

a. zombie
b. init
c. main
d. renderer

A

B- INIT

The init process, also known as process ID 1, is the first user-space process created by the Linux kernel during system startup. It has a special role in the operating system as the parent process of all other processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

____ is a thread library for Solaris that maps many user-level threads to one kernel thread.

a. Pthreads
b. Green threads
c. Sthreads
d. Java threads

A

B- GREEN THREADS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pthreads refers to ____.

a. the POSIX standard
b. an implementation for thread behavior
c. a specification for thread behavior
d. an API for process creation and synchronization

A

C- A SPECIFICATION FOR THREAD BEHAVIOR pthreads (POSIX Threads) is a specification for thread behavior. It defines a standard API for creating, manipulating, and synchronizing threads in a multi-threaded program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Cancellation points are associated with ____ cancellation.

a. asynchronous
b. deferred
c. synchronous
d. non-deferred

A

B- DEFERRED

Non-deferred cancellation, also known as asynchronous cancellation, is an alternative mechanism provided by the pthreads (POSIX Threads) API for thread cancellation. In contrast to deferred cancellation, non-deferred cancellation allows an immediate termination of the thread, regardless of its current execution state.

Synchronous cancellation does not rely on cancellation points. Synchronous cancellation refers to the immediate termination of a thread upon receiving a cancellation request, regardless of its current execution state. Synchronous cancellation allows the thread to release resources, complete critical sections, or perform necessary cleanup before termination.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Signals can be emulated in windows through ____.

a. asynchronous procedure calls
b. local procedure calls
c. remote procedure calls
d. none of the above

A

A- ASYNCHRONOUS PROCEDURE CALLS

By using APCs, you can deliver asynchronous notifications or perform actions in a target thread. This can be useful for implementing custom signal-like behavior or interrupting the execution flow of a specific thread.

Remote Procedure Call (RPC) is a mechanism used for inter-process communication (IPC) in distributed computing environments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

_____ is not considered a challenge when designing applications for multicore systems.

a. Deciding which activities can be run in parallel
b. Ensuring there is a sufficient number of cores
c. Determining if data can be separated so that it is accessed on separate cores
d. Identifying data dependencies between tasks

A

B- ENSURING THERE IS A SUFFICIENT NUMBER OF CORES (other options are about ensuring there can be more than one core to begin with)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A ____ provides an API for creating and managing threads.

a. set of system calls
b. multicore system
c. thread library
d. multithreading model

A

C- THREAD LIBRARY

17
Q

The most common technique for writing multithreaded Java programs is _____.

a. extending the Thread class and overriding the run() method
b. implementing the Runnable interface and defining its run() method
c. designing your own Thread class
d. using the CreateThread() function

A

B- IMPLEMENTING THE Runnable INTERFACE AND DEFINING ITS run() METHOD

18
Q

_________ involves distributing tasks across multiple computing cores.

a. Concurrency
b. Task parallelism
c. Data parallelism
d. Parallelism

A

B- TASK PARALLELISM

19
Q

Grand Central Dispatch handles blocks by ____.

a. placing them on a dispatch queue
b. creating a new thread
c. placing them on a dispatch stack
d. constructing a parallel region

A

A- PLACING THEM ON A DISPATCH QUEUE

Grand Central Dispatch (GCD) is a technology provided by Apple for concurrent programming

20
Q

An instruction that executes atomically ____.

a. must consist of only one machine instruction
b. executes as a single, uninterruptible unit
c. cannot be used to solve the critical section problem
d. all of the above

A

B- EXECUTES AS A SINGLE, UNINTERRUPTIBLE UNIT

21
Q

In Peterson’s solution, the ____ variable indicates if a process is ready to enter its critical section.

a. turn
b. lock
c. flag[i]
d. turn[i]

A

C- flag[i]

1.	Each process sets its own flag[i] to true when it wants to enter the critical section.
2.	The process assigns the turn variable to the other process, indicating that it is the other process’s turn.
3.	The process enters a busy-wait loop, continuously checking the other process’s flag[j] and turn variables to determine if it is its own turn to enter the critical section. If not, it waits until it becomes its turn.
22
Q

What is the correct order of operations for protecting a critical section using mutex locks?

a. release() followed by acquire()
b. acquire() followed by release()
c. wait() followed by signal()
d. signal() followed by wait()

All 4 steps to get blue

A

B- acquire() FOLLOWED BY release()

1.	Initialization: Create and initialize a mutex object.
2.	Locking: This is done by calling the lock or acquire function/method provided by the mutex object. The thread will wait if the mutex is already locked by another thread.
3.	Critical Section: After successfully acquiring the mutex lock, the thread can now safely enter and execute the critical section of code. This section contains the shared resource or the portion of code that needs to be accessed exclusively.
4.	Unlocking: Once the thread completes its operations in the critical section, it needs to release the mutex lock to allow other threads to enter. This is done by calling the unlock or release function/method provided by the mutex object.
23
Q

Assume an adaptive mutex is used for accessing shared data on a Solaris system with multiprocessing capabilities. Which of the following statements is not true?

a. A waiting thread may spin while waiting for the lock to become available.
b. A waiting thread may sleep while waiting for the lock to become available.
c. The adaptive mutex is only used to protect short segments of code.
d. Condition variables and semaphores are never used in place of an adaptive mutex.

A

D- CONDITION VARIABLES AND SEMAPHORES ARE NEVER USED IN PLACE OF AN ADAPTIVE MUTEX.

24
Q

Which of the following statements is true?

Select one:

a. A counting semaphore can never be used as a binary semaphore.
b. A binary semaphore can never be used as a counting semaphore.
c. Spinlocks can be used to prevent busy waiting in the implementation of semaphores.
d. Counting semaphores can be used to control access to a resource with a finite number of instances.

A

D- COUNTING SEMAPHORES CAN BE USED TO CONTROL ACCESS TO A RESOURCE WITH A FINITE NUMBER OF INSTANCES

Busy waiting, also known as spinning, refers to a technique where a thread or process continuously checks a condition or waits for an event in a loop without yielding the CPU or performing any other useful work.

Spinlocks can be used as low-level primitives for implementing synchronization constructs like semaphores. By themselves, spinlocks involve busy waiting.

25
Q

_____ is/are not a technique for managing critical sections in operating systems.

a. Peterson’s solution
b. Preemptive kernel
c. Non-preemptive kernel
d. Semaphores

A

A- PETERSON’S SOLUTION

While Peterson’s solution is an algorithm for mutual exclusion and can be used to coordinate access to critical sections, it is not a built-in mechanism provided by operating systems.

26
Q

Which of the following statements is true?

Select one:

a. Operations on atomic integers do not require locking.
b. Operations on atomic integers do require additional locking.
c. Linux only provides the atomic_inc() and atomic_sub() operations.
d. Operations on atomic integers can be interrupted.

A

A- OPERATIONS ON ATOMIC INTEGERS DO NOT REQUIRE LOCKING

27
Q

The OpenMP #pragma omp critical directive ___________.

Select one:

a. behaves much like a mutex lock
b. does not require programmers to identify critical sections
c. does not guarantee prevention of race conditions
d. is similar to functional languages

A

A- BEHAVES MUCH LIKE A MUTEX LOCK

The #pragma omp critical directive is a construct in the OpenMP (Open Multi-Processing) parallel programming model. It is used to create a critical section in a parallel region, ensuring that only one thread can execute that section at a time.

28
Q

Which of the following is true of multilevel queue scheduling?

Select one:

a. Processes can move between queues.
b. Each queue has its own scheduling algorithm.
c. A queue cannot have absolute priority over lower-priority queues.
d. It is the most general CPU-scheduling algorithm.

A

B- EACH QUEUE HAS ITS OWN SCHEDULING ALGORITHM

29
Q

The Linux CFS scheduler identifies _____________ as the interval of time during which every runnable task should run at least once.

Select one:

a. virtual run time
b. targeted latency
c. nice value
d. load balancing

A

B- TARGETED LATENCY

Targeted latency is the desired maximum delay or latency before a task or process is scheduled and executed. It plays a crucial role in real-time systems to ensure timely and predictable execution of tasks within their timing constraints.

30
Q

______ allows a thread to run on only one processor.

Select one:

a. Processor affinity
b. Processor set
c. NUMA
d. Load balancing

A

A- PROCESSOR AFFINITY

Processor affinity refers to the assignment or association of a particular thread or process to a specific processor or a subset of processors within a multi-processor system. It allows the operating system to control and dictate which processor(s) should execute a given thread or process.

31
Q

The two general approaches to load balancing are __________ and ____________.

Select one:

a. soft affinity, hard affinity
b. coarse-grained, fine-grained
c. soft real-time, hard real-time
d. push migration, pull migration

A

D- PUSH MIGRATION, PULL MIGRATION

Push migration involves transferring the data or application from the source system to the destination system without any request from the destination. This approach is also known as proactive migration. The source system initiates the transfer, and the destination system simply accepts the incoming data. It involves a separate process that runs periodically, ( e.g. every 200 milliseconds ), and moves processes from heavily loaded processors onto less loaded ones.

On the other hand, pull migration involves the destination system requesting the data or application from the source system. In pull migration, the destination system is in control of the migration process, and the source system simply responds to the destination’s request for data or application transfer. It involves idle processors taking processes from the ready queues of other processors.

32
Q

Which of the following would be an acceptable signal handling scheme for a multithreaded program?

Select one:

a. Deliver the signal to the thread to which the signal applies.
b. Deliver the signal to every thread in the process.
c. Deliver the signal to only certain threads in the process.
d. All of the above

A

D- ALL OF THE ABOVE

33
Q

The most common secondary storage device is ____.

Select one:

a. random access memory
b. solid state disks
c. tape drives
d. magnetic disk

A

D- MAGNETIC DISK