OS Assignment 4
Which of the following agents cannot cause a process to be placed into a suspended state? A. The user B. The operating system C. A timer D. The child process E. The parent process
A child process
In a global trace of running processes which of the following which of the following is NOT true. A: After a Timeout the next process in the queue immediately starts either resuming a previous process or starting a new one. B: How long processes can run before Timeouts are controlled by the dispatcher C: The dispatcher runs after I/O Requests D: Given a process shorter than the Timeout by the dispatcher, the dispatcher is run once that process has ended. E: Given a process longer than the Timeout the process is paused, and then the dispatcher runs.
After a Timeout the next process in the queue immediately starts either resuming a previous process or starting a new one.
Which of these functions for an operating system kernel is not correctly matched up with the correct category? A. Allocation of address space to processes; process management B. Management of process control blocks; process management C. Buffer management; I/O management D. Swapping; Memory management E. Page and segment management; Memory management
Allocation of address space to processes; process management
Which of the following is a challenge due to multicore systems? A. Amdahl's Law B. Concurrency C. Responsiveness D. Parallelism E. Balance
Balance
Which of the following is the correct clone() flag to write the thread ID of a child into ptid? A: CLONE_PARENT_SETTID B: CLONE_NEWPID C: CLONE_PID D: CLONE_THREAD E: CLONE_VFORK
CLONE_PARENT_SETTID
Which of the following is NOT true about thread cancellation? A: Cancellation of a target thread may occur in three different scenarios. B: Thread cancellation involves terminating a thread before it has completed. C: The difficulty with cancellation occurs in situations where resources have been allocated to a canceled thread. D: Canceling a thread asynchronously may not free a necessary system-wide resource. E: Deferred cancellation occurs only after the target thread has checked a flag to determine whether or not it should be canceled.
Cancellation of a target thread may occur in three different scenarios.
Which answer below is not one of the reasons of process termination? A. Bounds violation B. Data misuse C. Parent request D. Parent termination E. Child termination
Child termination
What is the correct order of steps for a multithreaded server? A: Client Requests Server, Server Creates new Thread to service the request, Server resumes listening for additional Client requests. B: Client Requests Server, Thread resumes listening for additional client requests, Server creates new Thread to service the request. C: Server requests Client, Thread creates new Thread to service the request, Thread resumes listening to additional Client requests. D: Thread requests Server, Server creates new Thread to service the request, Client resumes listening for additional Client requests. E: Client requests Thread, Server sits there, Nothing happens
Client Requests Server, Server Creates new Thread to service the request, Server resumes listening for additional Client requests.
What are the two main types of parallelism? A. Single parallelism and Multi-parallelism B. Thread parallelism and Process parallelism C. Computational parallelism and Balanced parallelism D. Implicit parallelism and Explicit parallelism E. Data parallelism and Task parallelism
Data parallelism and Task parallelism
Which of the following statements is not true about threads and processes? A. Each thread exclusively references different code, data and files, regardless of whether a process is single or multi-threaded. B. Sharing between threads is easier than sharing between processes. C. A process is an executing program, while threads operate within an executing program. D. Each thread has its own stack and registers, regardless of whether a process is single or multi-threaded. E. Sharing between processes can include implementing shared memory.
Each thread exclusively references different code, data and files, regardless of whether a process is single or multi-threaded.
Which of the following characteristics is NOT matched with the correct multithreading model? A: Each user-level thread maps to a kernel thread : Many-to-One B: Allows many user level threads to be mapped to many kernel threads : Many-to-Many C: Multiple threads may not run in parallel on muticore system because only one may be in kernel at a time : Many-to-One D: Allows many user level threads to be mapped to many kernel threads : Many-to-Many E: Creating a user-level thread creates a kernel thread : One-to-One
Each user-level thread maps to a kernel thread : Many-to-One
Which is not introduction to multithreading models Many-to-One? A. Each user-level thread maps to kernel thread. B. Many user-level threads mapped to single kernel thread C. One thread blocking causes all to block D. Multiple threads may not run in parallel on muticore system because only one may be in kernel at a time E. Few systems currently use this model
Each user-level thread maps to kernel thread.
Which of these is an example of a many-to-one thread? A. Lunaris Blue Threads B. POSIX Pthreads C. Windows threads D. Ahmdal's Threads E. GNU Portable Threads
GNU Portable Threads
All of the following are benefits of multi-threading, EXCLUDING? A: High Cost B: Responsiveness C: Resource Sharing D: Economy E: Scalability
High Cost
The order of the simplified process control block on the image 3.1 is: A: Identifier, state, priority, program counter, memory pointers, context data, I/O status information, accounting information. B: accounting information, Identifier, state, priority, program counter, memory pointers, context data, I/O status information. C: I/O status information, state, priority, context data, program counter, Identifier, memory pointers, accounting information. D: program counter, memory pointers, I/O status information, accounting information, Identifier, state, priority, context data. E: context data, I/O status information, accounting information, Identifier, state, priority, program counter, memory pointers.
Identifier, state, priority, program counter, memory pointers, context data, I/O status information, accounting information.
During Dr. Grant's lecture #16 on Threads, he showed an example of a Java multithreaded program and a C multithreaded program that calculates the sum of a number. In both programs, run()/runner() had a return type of void. Why would we not return the sum instead? A: If the program has to wait for the thread to return some data, then this defeats the purpose of running more than one thread at a time. B: We should wait until we need the data before retrieving it from the thread. C: The API won't allow us to return a value. D: The thread may still be processing the data, so it might return an incomplete value. E: Some threads may not have anything to return, so the API is written in such a way so they are not forced to return a value.
If the program has to wait for the thread to return some data, then this defeats the purpose of running more than one thread at a time.
Which of the following is NOT a benefit of Multithreaded Architecture A. Economy B. Resource Sharing C. Implementation D. Scalability E. Responsiveness
Implementation
While a program is executing, it can be uniquely characterized by a number of elements, EXCLUDING? A. Memory Pointers B. Program Counter C. State D. Interpreter E. I/O Status Info
Interpreter
What is the main responsibility of the dispatcher in process execution? A: It decides what process should be running and when it should be running. B: It decides when a process should be running. C: It decides what process should be running. D: It creates processes to be executed. E: It gets rid of bad code.
It decides what process should be running and when it should be running.
What defines a process to be an orphan process? A: It is a process where the parent process terminates before the current child process B: It is a process running in the background waiting for an event C: It is a process that has been terminated but is not immediately deallocated from memory D: It is a process that has been terminated and deallocated from memory
It is a process where the parent process terminates before the current child process
In the five-state process model why is the New state needed? A: It takes time to allocated and copy into memory what is going to be run. B: It is there to represent a program starting, no processing happens here. C: It is a state for when a process has a new request for the OS. D: The process is waiting for the CPU to finish the process that is currently working on E: It a notification that lets the process know that its ran into a new wild Pokémon
It takes time to allocated and copy into memory what is going to be run.
Which is not true of swapping? A: It will always enhance performance. B: It is an I/O operation. C: It happens when no processes in main memory are in the Ready state. D: It involves moving part or all of a process from main memory to disk. E: It moves a blocked process into a suspend queue.
It will always enhance performance.
Which of these is NOT a primary thread library? A. POSIX Pthreads B. Windows Threads C. Linux D. Java Threads
Linux
What does a memory table NOT do? A. Allocation of main memory to processes B. Location in memory being used as the source/destination of the I/O transfer C. Information needed to manage virtual memory D. Protection attributes of blocks of main memory or virtual memory E. Allocation of secondary memory to processes
Location in memory being used as the source/destination of the I/O transfer
Which type of multithreading model takes a lot of user-level threads and multiplexes them to "a smaller or equal number of kernel threads" without allowing a user-level thread to be bound to a kernel-level thread? A: Many-to-Many Model B: Many-to-One Model C: Two-level Model D: One-to-One Model
Many-to-Many Model
Which is NOT a benefit to using multi-threaded server architecture? A. Scalability B. Responsiveness C. Resource Sharing D. Economy E. Message Passing
Message Passing
Which of the following is NOT true about a One-to-One multithreading model? A: Multiplexes numerous User-Level Threads to a less than or equal to number of Kernel Threads. B: Each User-Level Thread connects to a Kernel Thread. C: Creation of a User-Level Thread also creates a Kernel Thread. D: Has more concurrency than Many-to-One multithreading model. E: Negatively impacts the performance of a system if there are a large number of user threads.
Multiplexes numerous User-Level Threads to a less than or equal to number of Kernel Threads.
What are the five states of the Five-State Process Model? A. New, Ready, Running, Exit, Blocked B. New, Dispatch, Release,Exit,Running C. Admit, Dispatch, Release, Exit, Blocked D. Blocked, Timeout, Release, New, Admit E. Ready, Running, Exit, Release, Admit
New, Ready, Running, Exit, Blocked
The Pthread datatype pthread_once_t is best described by which of the following? A. Condition variable B. One-time initialization control context C: Thread attributes object D: Thread identifier E: Mutex attributes object
One-time initialization control context
Which of the following models is NOT an example of a multithreading model? A. Many-to-Many B. One-to-One C. Many-to-One D. One-to-Many
One-to-Many
Which one is NOT a Kernel thread? A. Windows B. POSIX C. Linux D. Mac OS X E. Solaris
POSIX
Which of the following implies a system can perform more than one task simultaneously? A. Parallel systems B. Many-to-one multi-threading models C. Multicore Programming D. Concurrency E. Parallelism
Parallelism
What is not an example of an event that would cause a process creation? A: Parent request B: User login C: New batch job D: Providing service to OS E: Parent calling
Parent request
Which of the following is not a valid state of a thread? A: Parsing B: Running C: Waiting D: Ready E: Terminated
Parsing
What happens if no interrupts are pending the processor? A. Proceeds to the fetch stage and fetches the next instruction of the current program in the current process B. Sets the program counter to the starting address of an interrupt handler program C. Switches from user mode to kernel mode so that the interrupt processing code may include privileged instructions D. An error or exception condition generated within the currently running process
Proceeds to the fetch stage and fetches the next instruction of the current program in the current process
What does 'N' represent in Amdahl's law? A. Chicken B: Serial Portion C: Speedup D: Parallel Components E. Processing Cores
Processing Cores
A blocking send() and a blocking receive() is known as a what? A. Asynchronous communication B. Miscommunication C. Rendezvous D. Synchronous Communication
Rendezvous
What are some of the benefits of multi-threaded programs? A. Less Storage Space B. Redundancy C. Can be woven into a net D. Lower Cost E. Responsiveness
Responsiveness
What are the benefits of using threads? A: Responsiveness, resource sharing, economy, and scalability B: Multiple processes, parallelism, and concurrency C: Data parallelism and task parallelism D: Dividing activities, balance, data splitting, data dependency, testing and debugging E: You can sew clothes together
Responsiveness, resource sharing, economy, and scalability
What signal flag is passed to the kill() function when pressing "ctrl+c" while running a process in the terminal? A: SIGINT B: SIGTERM C: SIGQUIT D: SIGHUP E: SIGEND
SIGINT
Which of the following is used in UNIX systems to notify a process that a particular event has occurred? A. Program Counter B: Threads C: Thread Library D. Signals E. Parallelism
Signals
Which of the following is not a state that a thread can be in? A. Terminated B. Running C. Skipped D. Waiting E. Ready
Skipped
What is NOT a reason for Process Creation? A. New batch job B. Spawned by memory table C. Interactive logon D. Spawned by existing process E. Created by OS to provide a service
Spawned by memory table
Which one of the following is NOT shared by the threads of the same process? A. Open files B. Data section C. Signals D. Stack E. Address space
Stack
What is it called when the OS needs to release sufficient main memory to bring in a process that is ready to execute, in regards to process suspension? A. Interactive User Request B. Parent Process Request C. Timing D. Swapping
Swapping
Which is NOT an advantage of threading pools? A: Synchronous tasks can be completed with more efficiency B: Usually slightly faster to service a request with an existing thread than create a new thread C: Allows the number of threads in the application(s) to be bound to the size of the pool D: Separating task to be performed from mechanics of creating task allows different strategies for running task
Synchronous tasks can be completed with more efficiency
Which of the following is the correct TID for the thread group leader in a process with PID of 2001 and a thread count of 4? A: TID = 2001 B. TID = 2002 C. TID = 2003 D. TID = 2004
TID = 2001
Which best describes process control information? A: The additional information needed by the OS to control and coordinate the various active processes B: Each process is assigned unique numeric identifier C: Usage of program status word (PSW) D: A process must include a program or a set of programs to be executed E: The collection of program, data, stack, and attributes
The additional information needed by the OS to control and coordinate the various active processes
What do file tables NOT provide information about? A. Other attributes B. Current status C. Location on secondary memory D. Existence of files E. The contents inside a file
The contents inside a file
Which of the following options describe the drawback(s) of a many-to-many multithreading model? A: The many-to-many model is the most difficult to implement, and limiting the number of kernel threads has become less important as technology has advanced. B: With the many-to-many model, only one thread can access the kernel at a time, so multiple threads can not run in parallel on multicore systems. C: Because creating a user thread requires creating a corresponding kernel thread, a large number of threads may be created and burden the performance of a system. D: On a many-to-many model, when a thread performs a blocking system call, the kernel may schedule another thread for execution, preventing blocking of the entire process. E: A two-level model is superior to the many-to-many model, as it allows a user-level thread to be bound to a kernel thread.
The many-to-many model is the most difficult to implement, and limiting the number of kernel threads has become less important as technology has advanced.
In the one to one thread model, what is a disadvantage of using this thread technique? A: The number of user threads is restricted to the available amount of kernel threads B: Creating kernel processes slows down the system C: Allows OS to create a certain amount of kernel threads D: Many user threads can hold up an assigned kernel thread, thus creating thread blocking E: There are no disadvantages to one to one thread model, it is the single greatest technique in the history of computers.
The number of user threads is restricted to the available amount of kernel threads
Which of the following is NOT a trait of a vfork? A: There is no duplication of virtual memory B: Parent memory is not shared C: The child of vfork() is not always guaranteed to run D: Changes to stack or heap in child are not seen by the parent E: vfork() Creates 2 child processes
There is no duplication of virtual memory
What is an advantage of multithreading? A: There is simultaneous and parallelized occurrence of tasks. B: Decreased potential for deadlock occurrence. C: It eliminates overhead switching of context. D: it makes it easier for programmers to debug
There is simultaneous and parallelized occurrence of tasks.
Which implicit threading method is designed to create a pool of pre-built threads ready for work commands? A: Thread Pools B: OpenMP C: Grand Central Dispatch D: Thread Library E: PThread
Thread Pools
What windows thread structure can be defined as containing a thread id, user mode stack, and thread local storage, in user space? A. Dynamic hotdog block B: Kernel thread block C: Executive thread block D: Dynamic link libraries E. Thread environment block
Thread environment block
Which of the following does NOT require kernel mode privileges? A. Recompiling the kernel B. Thread switching C. Memory management D. I/O device access E. Halt operations
Thread switching
Which of the following is not part of the Two-State Process Mode? A. Running B. Not Running C. Timeout D. Dispatch
Timeout
Which type of multithreading model that allows user thread to be bound to kernel thread and allows many user level threads to be mapped to many kernel threads? A. One-to-One Model B: Many-to-One Model C: Many-to-Many Model D. Two-level model
Two-level model
Which is the main difference between the user thread and Kernel threads? A: User threads are managed by the user while the operating system manages kernel threads. B: Kernel threads are managed by the user while the operating system manages user threads. C: Kernel threads are faster than User threads D: Kernel threads are mapped to a user thread E: There is no difference
User threads are managed by the user while the operating system manages kernel threads.
Which answer choice is true regarding the Process Control Block? A. Created and managed by the user B. It contains five different process element C. It's not possible to interrupt a process once its running D. You can resume the execution of an interrupted running process E. It is a key tool that allows for a single process
You can resume
What is a child process that has been terminated but is still located in memory called? A. Unallocated process B. Sleeping process C. Orphan process D. Zombie process
Zombie process
What are parallel regions? A. they notify a process that a particular event has occurred. B. blocks of code that can run in parallel C. a communication mechanism from the kernel to the upcall handler in the thread library D. management done by user-level threads library
blocks of code that can run in parallel
What is the fast method of process creation that Pthreads uses? A. exec() B. clone() C. fork() D. vfork()
clone()
What method of creating 100,000 processes takes the least amount of time? A. fork() B. vfork() C. clone() D. fork() + exec() E. vfork() + exec()
clone()
Which of the following methods of process creation results in the shortest time required to create large amounts of processes. A. fork() B. vfork() C. fork() + exec() D. clone()
clone()
Which system call is the fastest to create processes? A: clone() B: vfork() C: fork() D: fork() + exec() E: vfork() + exec
clone()
Which of the following lists best describes what is shared between multi-threaded processes? A: code, data, and files B: data, files, stack C: files, registers, stack D: code, files, registers E: nothing is shared between them
code, data, and files
How do you voluntary exit a process? A. close(int fd) B. return -1 C. pthread_exit(void *retval) D. kill(pid, signal) E. exit(status)
exit(status)
What is a downside of multithreading? A: it makes it harder for programmers to debug B: you have to do concurrent execution on a single-core system C: you have to do parallelism on a multi-core system D: you can't share information in between the threads E: there are both bugs and rats that you have to deal with
it makes it harder for programmers to debug
Synchronous Threading is similar to vfork() in which when the parent creates a children A: it must wait for all of its children to terminate. B: the parent resumes and both execute concurrently. C: the child(ren) cannot be guaranteed to be called. D: the parent and child(ren) share little data between them.
it must wait for all of its children to terminate.
What is the Java function call that causes a parent thread to wait for a child thread to finish? A. sleep() B. pthread_join() C. WaitForSingleObject(); D. join() E. pthread_create()
join()
Which of the following are not a characteristic of the System mode of execution? A. more privilege mode B. less privilege of the mode C: referred to as control mode D: Kernel of the Operating system
less privilege of the mode
Which of the following is NOT a parameter for the creation of a Windows thread (pthread_create(?);) A: list of joined threads B: creation flags C: security attributes D: stack size E: thread function
list of joined threads
What is the order of events for fork-join? A: main thread, fork, task, join B: main thread, task, fork, join C: task, fork, join, main thread D: task, join, main thread, fork E: fork, join, main thread, task
main thread, fork, task, join
Which of the following functions cancels a specified POSIX thread (pthread)? A: pthread_cancel(tid) B: pthread_exit(0) C: pthread_join(tid, NULL) D: CloseHandle(Handle) E: join()
pthread_cancel(tid)
When you want to end a thread but not end the parent thread, what function should you use? A. exit(0); B. pthread_join C. pthread.h D. pthread_exit(0); E. pthread_create()
pthread_exit(0);
Grand Central Dispatch (GCD) is a combination of which of the following? A. run-time library and language extensions B. run-time library, an API, and language extensions C: An API and language extensions D: run-time library and OpenMP E: An API, language extensions, and OpenMP
run-time library, an API, and language extensions