CS 372 Quiz 2 Practice

Description

This is the second quiz questions for practice. This is also a partial review for Midterm 1.
Amanda Hatch
Quiz by Amanda Hatch, updated more than 1 year ago
Amanda Hatch
Created by Amanda Hatch almost 10 years ago
519
0

Resource summary

Question 1

Question
The ____ of a process contains temporary data such as function parameters, return addresses, and local variables.
Answer
  • program counter
  • data section
  • text section
  • stack

Question 2

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

Question 3

Question
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?
Answer
  • 21
  • 1625
  • 23
  • 80

Question 4

Question
The ____________ class must be extended when implementing a remote object.
Answer
  • java.rmi.Remote
  • Naming.lookup
  • None. java allows any class to be a remote object
  • java.rmi.server.UnicastRemoteObject

Question 5

Question
Which of the following statements is true?
Answer
  • Message passing is typically faster than shared memory.
  • Message passing is most useful for exchanging large amounts of data.
  • Shared memory is far more common in operating systems than message passing.
  • Shared memory is typically faster than message passing

Question 6

Question
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.
Answer
  • 150.55.66.77:80 and 202.28.15.123:3500
  • 150.55.66.77:80 and 202.28.15.123:80
  • 150.55.66.77:2000 and 202.28.15.123:80
  • 150.55.66.77:150 and 202.28.15.123:80

Question 7

Question
A process control block ____.
Answer
  • includes information on the process's state
  • determines which process is to be executed next
  • is an example of a process queue
  • stores the address of the next instruction to be processed by a different process

Question 8

Question
The difference between a program and a process is that a program is an active entity while a process is a passive entity.
Answer
  • True
  • False

Question 9

Question
The exec() system call creates a new process.
Answer
  • True
  • False

Question 10

Question
The list of processes waiting for a particular I/O device is called a(n) ____.
Answer
  • device queue
  • ready queue
  • standby queue
  • interrupt queue

Question 11

Question
All access to POSIX shared memory requires a system call.
Answer
  • True
  • False

Question 12

Question
Local Procedure Calls in Windows XP are similar to Remote Procedure Calls.
Answer
  • True
  • False

Question 13

Question
Java's RMI is a feature similar to RPCs
Answer
  • True
  • False

Question 14

Question
For a single-processor system, there will never be more than one process in the Running state.
Answer
  • True
  • False

Question 15

Question
Shared memory is a more appropriate IPC mechanism than message passing for distributed systems.
Answer
  • True
  • False

Question 16

Question
A socket is identified by an IP address concatenated with a port number.
Answer
  • True
  • False

Question 17

Question
Sockets are considered a high-level communications scheme.
Answer
  • True
  • False

Question 18

Question
The Mach operating system treats system calls with message passing.
Answer
  • True
  • False

Question 19

Question
The _____________ refers to the number of processes in memory.
Answer
  • long-term scheduler
  • process count
  • degree of multiprogramming
  • CPU scheduler

Question 20

Question
When using RMI, remote objects are referenced via a proxy.
Answer
  • True
  • False

Question 21

Question
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?
Answer
  • The child is a duplicate of the parent.
  • All of the above
  • The child process runs concurrently with the parent.
  • The child process has a new program loaded into it.

Question 22

Question
A _________________ saves the state of the currently running process and restores the state of the next process to run.
Answer
  • state switch
  • save-and-restore
  • none of the above
  • context switch

Question 23

Question
A process may transition to the Ready state by which of the following actions?
Answer
  • Newly-admitted process
  • Awaiting its turn on the CPU
  • Completion of an I/O event
  • All of the above

Question 24

Question
In a(n) ____ temporary queue, the sender must always block until the recipient receives the message.
Answer
  • unbounded capacity
  • variable capacity
  • zero capacity
  • bounded capacity

Question 25

Question
A blocking send() and blocking receive() is known as a(n) _________________
Answer
  • rendezvous
  • asynchronous message
  • blocked message
  • synchronized message

Question 26

Question
____ is a thread library for Solaris that maps many user-level threads to one kernel thread.
Answer
  • Pthreads
  • Green threads
  • Java threads
  • Sthreads

Question 27

Question
In multithreaded programs, the kernel informs an application about certain events using a procedure known as a(n) ____.
Answer
  • event handler
  • signal
  • upcall
  • pool

Question 28

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

Question 29

Question
A ____ provides an API for creating and managing threads.
Answer
  • thread library
  • multithreading model
  • multicore system
  • set of system calls

Question 30

Question
The _____ model multiplexes many user-level threads to a smaller or equal number of kernel threads.
Answer
  • one-to-one
  • many-to-one
  • two-level
  • many-to-many

Question 31

Question
The _____ model maps many user-level threads to one kernel thread.
Answer
  • two-level
  • many-to-many
  • one-to-one
  • many-to-one

Question 32

Question
The _____ model maps each user-level thread to one kernel thread.
Answer
  • many-to-one
  • many-to-many
  • two-level
  • one-to-one

Question 33

Question
The _____ model allows a user-level thread to be bound to one kernel thread.
Answer
  • one-to-one
  • many-to-many
  • two-level
  • many-to-one

Question 34

Question
The most common technique for writing multithreaded Java programs is _____.
Answer
  • implementing the Runnable interface and defining its run() method
  • using the CreateThread() function
  • extending the Thread class and overriding the run() method
  • designing your own Thread class

Question 35

Question
In Pthreads, a parent uses the pthread_join() function to wait for its child thread to complete. What is the equivalent function in Win32?
Answer
  • join()
  • WaitForSingleObject()
  • win32_join()
  • wait()

Question 36

Question
Which of the following statements regarding threads is false?
Answer
  • Sharing is automatically provided in Java threads.
  • Both Pthreads and Win32 threads share global data.
  • The start() method actually creates a thread in the Java virtual machine.
  • The Java method join() provides similar functionality as the WaitForSingleObject in Win32.

Question 37

Question
Pthreads refers to ____.
Answer
  • an API for process creation and synchronization.
  • the POSTFIX standard.
  • an implementation for thread behavior.
  • a specification for thread behavior.

Question 38

Question
A _____ uses an existing thread — rather than creating a new one — to complete a task.
Answer
  • lightweight process
  • thread pool
  • asynchronous procedure call
  • scheduler activation

Question 39

Question
Assuming the Java class Worker implements the Runnable interface. Which of the following statements creates a thread using the Worker class?
Answer
  • Thread worker = new Thread(new Worker());
  • Thread worker = new Runnable(new Worker());
  • Worker worker = new Worker();
  • Thread worker = new Thread();

Question 40

Question
Calling the start() method of a Java thread
Answer
  • only creates the thread
  • creates the thread and invokes its run() method
  • the start() method cannot be called directly
  • can be either "only creates the thread" or "the start() method cannot be called directly"

Question 41

Question
A thread is composed of a thread ID, program counter, register set, and heap.
Answer
  • True
  • False

Question 42

Question
Virtually all contemporary operating systems support kernel threads.
Answer
  • True
  • False

Question 43

Question
Linux distinguishes between processes and threads.
Answer
  • True
  • False

Question 44

Question
Cancellation points are associated with ____ cancellation.
Answer
  • asynchronous
  • deferred
  • non-deferred
  • synchronous

Question 45

Question
In Java, data shared between threads is simply declared globally.
Answer
  • True
  • False

Question 46

Question
Each thread has its own register set and stack.
Answer
  • True
  • False

Question 47

Question
Deferred cancellation is preferred over asynchronous cancellation.
Answer
  • True
  • False

Question 48

Question
The single benefit of a thread pool is to control the number of threads.
Answer
  • True
  • False

Question 49

Question
It is possible to create a thread library without any kernel-level support.
Answer
  • True
  • False

Question 50

Question
Which of the following would be an acceptable signal handling scheme for a multithreaded program?
Answer
  • Deliver the signal to every thread in the process.
  • Deliver the signal to the thread to which the signal applies.
  • All of the above
  • Deliver the signal to only certain threads in the process.

Question 51

Question
Signals can be emulated in windows through ____.
Answer
  • none of the above
  • local procedure calls
  • asynchronous procedure calls
  • remote procedure calls

Question 52

Question
Thread-specific data is data that ____.
Answer
  • has been modified by the thread, but not yet updated to the parent process
  • is generated by the thread independent of the thread's process
  • is not associated with any process
  • is copied and not shared with the parent process

Question 53

Question
LWP is ____.
Answer
  • placed between system and kernel threads
  • common in systems implementing one-to-one multithreading models
  • short for lightweight processor
  • placed between user and kernel threads

Question 54

Question
Windows XP uses the ____.
Answer
  • many-to-many model
  • one-to many-model
  • many-to-one model
  • one-to-one model
Show full summary Hide full summary

Similar

Plant and animal cells
charlotteireland
Of Mice and Men
becky_e
Key word flashcards
I M Wilson
Geography Section 1 (Rivers and Coasts)
Beth Goodchild
L'environnement
Bryony Whitehead
el centro comercial
Nicholas Guardad
The Skeleton and Muscles
james liew
2PR101 1.test - Doplňující otázky
Nikola Truong
New PSBD Question
gems rai
Romeo and Juliet Key Quotations
Rachel Sheppard
AAHI_Card set 3 (Vital sign parameters - Adult)
Tafe Teachers SB