Saturday, 24 August 2019

Processes and Threads (Quiz)

Question 1
The list of processes waiting for a particular I/O device is called a(n) ____.
  1. standby queue
  2. device queue
  3. ready queue
  4. interrupt queue
Solution: device queue

Question 2
A _________________ saves the state of the currently running process and restores the state of the next process to run.
  1. save-and-restore
  2. state switch
  3. context switch
  4. process control block
Solution: context switch

Question 3
The ____ of a process contains temporary data such as function parameters, return addresses, and local variables. 
  1. text section
  2. data section
  3. program counter
  4. stack 
 Solution: stack

Question 4
A process that has terminated, but whose parent has not yet called wait(), is known as a ________ process. 
  1. zombie
  2. orphan
  3. terminated
  4. init 
 Solution: zombie

Question 5
The _______ process is assigned as the parent to orphan processes.
  1. zombie
  2. init
  3. main
  4. renderer 
 Solution: init

Question 6
Which of the following statements is true?
  1.  Shared memory is typically faster than message passing.
  2. Message passing is typically faster than shared memory.
  3. Message passing is most useful for exchanging large amounts of data.
  4. Shared memory is far more common in operating systems than message passing. 
Solution: Shared memory is typically faster than message passing.

Question 7
A process control block ____.
  1. includes information on the process's state
  2. stores the address of the next instruction to be processed by a different process
  3. determines which process is to be executed next
  4. is an example of a process queue 
 Solution: includes information on the process's state

 Question 8
All processes in UNIX first translate to a zombie process upon termination.
  1. True
  2. False 
 Solution: True

Question 9
Child processes inherit UNIX ordinary pipes from their parent process because:
  1.  The pipe is part of the code and children inherit code from their parents.
  2. A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents.
  3. The STARTUPINFO structure establishes this sharing.
  4. All IPC facilities are shared between the parent and child processes. 
Solution: A pipe is treated as a file descriptor and child processes inherit open file descriptors from their parents.

Question 10
The _____________ refers to the number of processes in memory.
  1. process count
  2. long-term scheduler
  3. degree of multiprogramming
  4. CPU scheduler
Solution: degree of multiprogramming

Question 11
_____ is not considered a challenge when designing applications for multicore systems.
  1. Deciding which activities can be run in parallel
  2. Ensuring there is a sufficient number of cores
  3. Determining if data can be separated so that it is accessed on separate cores
  4. Identifying data dependencies between tasks.

Solution: Ensuring there is a sufficient number of cores

Question 12
Which of the following would not be an acceptable signal handling scheme for a
multithreaded program?
  1. Deliver the signal to the thread to which the signal applies.
  2. Deliver the signal to every thread in the process.
  3. Deliver the signal to only certain threads in the process.
  4. Do not deliver the signal to any of the threads in the process.
Solution: Do not deliver the signal to any of the threads in the process.

Question 13
The ____ multithreading model multiplexes many user-level threads to a smaller or equal number of kernel threads.
  1. many-to-one model
  2. one-to-one model
  3. many-to-many model
  4. many-to-some model
Solution: many-to-many model

Question 14
A _____ uses an existing thread — rather than creating a new one — to complete a task.
  1. lightweight process
  2. thread pool
  3. scheduler activation
  4. asynchronous procedure call
Solution: thread pool

Question 15
_________ involves distributing tasks across multiple computing cores.
  1. Concurrency
  2. Task parallelism
  3. Data parallelism
  4. Parallelism
Solution: Task parallelism

Question 16
A ____ provides an API for creating and managing threads.
  1. set of system calls
  2. multicore system
  3. thread library
  4. multithreading model
Solution: thread library

Question 17
Thread-local storage is data that ____.
  1. is not associated with any process
  2. has been modified by the thread, but not yet updated to the parent process
  3. is generated by the thread independent of the thread's process
  4. is unique to each thread
Solution: is unique to each thread

Question 18
Signals can be emulated in windows through ____.
  1. asynchronous procedure calls
  2. local procedure calls
  3. remote procedure calls
  4. synchronous procedure calls 
 Solution: asynchronous procedure calls

Question 19
Pthreads refers to ____.
  1. the POSIX standard.
  2. an implementation for thread behavior. 
  3. a specification for thread behavior.
  4. an API for process creation and synchronization. 
 Solution: a specification for thread behavior.

Question 20
According to Amdahl's Law, what is the speedup gain for an application that is 60% parallel and we run it on a machine with 4 processing cores? 
  1. 1.82
  2. 0.7
  3. 0.55
  4. 1.43 
 Solution: 1.43 

Open Source Development Tools and Overview (Quiz)

Question 1
________ is the proper filename for the file that contains targets, dependencies and rules which are used to define how your source code should be built into a binary executable.
  1. compiler
  2. make
  3. gcc
  4. Makefile
Solution:  Makefile

Question 2
What editor are you required to use in order to write source code on Linux?
  1. nano
  2. vim
  3. Any editor you are comfortable with
  4. emacs
Solution:  Any editor you are comfortable with

Question 3
Which gcc compiler option should you use in order to include symbols for debugging?
  1. -Wextra
  2. -o
  3. -Wall
  4. -g  
Solution: -g

Question 4
Before committing changes, what git command is used in order to include updates made to files that already exist in a local git repository? 
  1. update
  2. pull
  3. add
  4. push  
Solution: add

Question 5
When working with a remote git repository, what command should be used in order to synchronize changes from the the remote repository into the local repository? 
  1. update
  2. add
  3. push
  4. pull  
Solution: pull

Question 6
Which is not another term for kernel mode?
  1. system mode
  2. operating mode
  3. privileged mode 
  4. supervisor mode 
Solution: operating mode

Question 7
A(n) ________ is the unit of work in a system
  1. timer
  2. process
  3. operating system
  4. mode bit  
Solution: process

Question 8
What statement concerning privileged instructions is considered false?
  1. They can be executed in user mode.
  2. They are used to manage interrupts.
  3. They can be executed in kernel mode.
  4. They may cause harm to the system. 
Solution: They can be executed in user mode.

Question 9
A(n) ____ is a custom build of the Linux operating system
  1. installation
  2. LiveCD
  3. distribution
  4. VMWare Player
 Solution: distribution

Question 10
The most common secondary storage device is ____.
  1. magnetic disk
  2. tape drives
  3. random access memory
  4. solid state disks
 Solution: magnetic disk

Question 11
The two separate modes of operating in a system are
  1. user mode and kernel mode
  2. supervisor mode and system mode
  3. physical mode and logical mode
  4. kernel mode and privileged mode  
Solution: user mode and kernel mode

Question 12
Embedded computers typically run ____ operating system
  1. a clustered
  2. a network
  3. the Windows XP
  4. a real-time
Solution: a real-time

Question 13
Which of the following operating systems is not open source?
  1. PCLinuxOS
  2. BSD UNIX
  3. Linux
  4. Windows 
Solution:  Windows

Question 14
Microkernels use _____ for communication.
  1. virtualization
  2. message passing
  3. shared memory
  4. system calls 
Solution: message passing

Question 15
If a program terminates abnormally, a dump of memory may be examined by a ____ to determine the cause of the problem. 
  1. module
  2. control card
  3. debugger
  4. shell 
 Solution: debugger

Question 16
_____ allow operating system services to be loaded dynamically.
  1. Virtual machines
  2. Modules
  3. File systems
  4. Graphical user interfaces
Solution: Modules

Question 17
_____ provide(s) an interface to the services provided by an operating system.
  1. System calls
  2. Communication
  3. Simulators
  4. Shared memory
Solution: System calls

Question 18
A microkernel is a kernel ____.
  1. that is compressed before loading in order to reduce its resident memory size
  2. that is compiled to produce the smallest size possible when stored to disk
  3. containing many components that are optimized to reduce resident memory size
  4. that is stripped of all nonessential components 
 Solution: that is stripped of all nonessential components

Question 19
A _____ is an example of a systems program.
  1.  text formatter
  2. database system
  3. command interpreter
  4. Web browser 
Solution: command interpreter

Question 20
A boot block ____.
  1. typically only knows the location and length of the rest of the bootstrap program
  2. is composed of multiple disk blocks
  3. typically is sophisticated enough to load the operating system and begin its execution
  4. is composed of multiple disk cylinders 
Solution:
typically only knows the location and length of the rest of the bootstrap program