Deck 4: Exploring Semaphores and Multithreading in Operating Systems

ملء الشاشة (f)
exit full mode
سؤال
In the 1970s and 1980s, what was an early roadblock to concurrent programming?

A) Early operating systems did not allow several programs to execute concurrently.
B) Early computers were too slow to permit concurrency.
C) Early programming languages did not include primitives enabling programmers to write concurrent programs.
D) all of the above
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
________, ________ and ________ are general-purpose programming languages that directly support concurrency through multithreading.

A) C, C++, Python
B) Java, C#, Visual Basic .NET
C) C++, Visual C++ .NET, Python
D) Java, C, C#
سؤال
Which of the following statements about threads is false?

A) Threads possess a subset of the resources contained in a process.
B) Threads can be dispatched to a processor.
C) Threads cannot execute instructions independent of other processes.
D) A process's threads can cooperate to attain a common goal efficiently.
سؤال
The POSIX specification provides the ________ standard for developing portable multithreaded applications.

A) Win32 threads
B) Pthreads
C) C-threads
D) portable threads
سؤال
Multithreading is important because it can ________.

A) facilitate software design and promote good programming practices
B) improve performance and scalability
C) facilitate cooperation/synchronization of activities
D) all of the above
سؤال
Which of the following applications can benefit from multithreading?

A) a simple text editor
B) a Web server
C) an image viewer
D) both a and c
سؤال
A thread enters the waiting state when ________.

A) it momentarily has no work to perform
B) it cannot perform further operations until it receives a signal from another thread
C) it must wait for the completion of an I/O request
D) all of the above
سؤال
A(n) ________ thread can enter the sleeping state for a specified period of time, after which it enters to the ________ state.

A) ready, running
B) running, ready
C) running, blocked
D) waiting, ready
سؤال
Many operating systems require ________ instructions to share resources than they do to initialize them, so in these systems, thread creation is ________ than process creation.

A) more, faster
B) more, slower
C) fewer, faster
D) fewer, slower
سؤال
Which of the following statements about thread operations is true?

A) When a thread joins another thread, the former does not execute until the latter terminates.
B) Thread cancellation always terminates the target thread immediately.
C) A thread can mask an abort signal.
D) A process can continue execution after its primary thread exits.
سؤال
User-level thread implementations are also called ________ thread mappings.

A) one-to-one
B) one-to-many
C) many-to-one
D) many-to-many
سؤال
Threads in user space can be more appropriate than kernel threads because ________.

A) user-level threads do not require the operating system to support threads.
B) application developers can tune the threading library's scheduling algorithm to meet the needs of specific applications.
C) user-level threads do not invoke the kernel for synchronization, which can reduce overhead.
D) all of the above
سؤال
Kernel-level threads are often described as ________ thread mappings.

A) one-to-one
B) one-to-many
C) many-to-one
D) many-to-many
سؤال
Which of the following statements about kernel-level threads is false?

A) The kernel can manage each of a process's threads individually.
B) A process that uses kernel-level threads often can adjust the level of service each thread receives from the operating system.
C) Software that employs kernel-level threads often is more portable than software that employs user-level threads.
D) Kernel-level threads require the operating system to manage all threads in the system.
سؤال
The amount of overhead incurred by many-to-many thread mappings that implement thread pooling is _________ the amount of overhead incurred by one-to-one mappings.

A) greater than
B) less than
C) the same as
D) unrelated to
سؤال
Which of the following statements about scheduler activations is false?

A) A scheduler activation executes the process's user-level threading-library initialization code.
B) A scheduler activation is a user thread that can notify a kernel-level threading library of events.
C) A scheduler activation creates threads and requests additional processors for its threads, if necessary.
D) An additional scheduler activation is created for each processor allocated to a process.
سؤال
In which of the following events would the operating system send a synchronous signal?

A) when an I/O operation completes
B) when the operating system suspends a process
C) when a process or thread performs an illegal memory operation
D) when the operating system continues a process
سؤال
According to the POSIX specification, processes send signals by specifying a ________.

A) thread identifier
B) process identifier
C) pointer to a process control block
D) any of the above are allowed
سؤال
What could cause a thread to terminate prematurely?

A) an exception (such an illegal memory reference)
B) a cancellation signal from a process or thread
C) both a and b
D) neither a nor b
سؤال
A POSIX thread that defers cancellation ________.

A) can be terminated at any point during its execution
B) will not be cancelled until it explicitly checks for a cancellation request
C) is not notified when a cancellation operation has been requested
D) none of the above
سؤال
According to the POSIX threading API, processor registers, a stack and a signal mask are ________.

A) maintained individually for each thread in a process
B) shared between all threads in a process
C) shared between some threads in a process
D) none of the above
سؤال
In Linux, what is the difference between the fork and clone system calls?

A) clone accepts arguments that specify which resources to share with the spawned process.
B) Linux responds to the clone system call by creating a new task that contains a copy of all of its parent's resources.
C) clone creates a copy of the calling task, and the copy becomes the parent of the task that issued the clone system call.
D) fork and clone spawn child processes in exactly the same way.
سؤال
In Linux, a process in the ________ state has been terminated but has not yet been removed from the system.

A) sleeping
B) blocked
C) zombie
D) dead
سؤال
Which of the following statements about Windows XP threads is false?

A) Threads are the primary unit of execution in Windows XP.
B) Threads execute a portion of a process's code in the process's context.
C) Each thread contains its own execution context.
D) Each thread belonging to a process is assigned a unique virtual address space.
سؤال
In Windows XP, a fiber is scheduled for execution ________.

A) by the thread that creates it
B) by the operating system's scheduler
C) by the process
D) none of the above
سؤال
The size of a thread pool in Windows XP is ________.

A) constant and specified by the programmer for each process
B) constant for all processes on a system
C) variable, modified by the system in response to the volume of requests
D) all of the above are possible
سؤال
In Windows XP, a thread enters the ________ state when the thread's requested data is currently unavailable, but the thread is otherwise ready to execute.

A) standby
B) transition
C) waiting
D) unknown
سؤال
In Java, the ________ method of the Thread class contains the code that performs the "real work" of a thread.

A) run
B) start
C) go
D) main
سؤال
Java implements thread signaling using the ________ method of the Thread class.

A) alert
B) signal
C) interrupt
D) wake
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/29
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 4: Exploring Semaphores and Multithreading in Operating Systems
1
In the 1970s and 1980s, what was an early roadblock to concurrent programming?

A) Early operating systems did not allow several programs to execute concurrently.
B) Early computers were too slow to permit concurrency.
C) Early programming languages did not include primitives enabling programmers to write concurrent programs.
D) all of the above
Early programming languages did not include primitives enabling programmers to write concurrent programs.
2
________, ________ and ________ are general-purpose programming languages that directly support concurrency through multithreading.

A) C, C++, Python
B) Java, C#, Visual Basic .NET
C) C++, Visual C++ .NET, Python
D) Java, C, C#
Java, C#, Visual Basic .NET
3
Which of the following statements about threads is false?

A) Threads possess a subset of the resources contained in a process.
B) Threads can be dispatched to a processor.
C) Threads cannot execute instructions independent of other processes.
D) A process's threads can cooperate to attain a common goal efficiently.
Threads cannot execute instructions independent of other processes.
4
The POSIX specification provides the ________ standard for developing portable multithreaded applications.

A) Win32 threads
B) Pthreads
C) C-threads
D) portable threads
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
5
Multithreading is important because it can ________.

A) facilitate software design and promote good programming practices
B) improve performance and scalability
C) facilitate cooperation/synchronization of activities
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
6
Which of the following applications can benefit from multithreading?

A) a simple text editor
B) a Web server
C) an image viewer
D) both a and c
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
7
A thread enters the waiting state when ________.

A) it momentarily has no work to perform
B) it cannot perform further operations until it receives a signal from another thread
C) it must wait for the completion of an I/O request
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
8
A(n) ________ thread can enter the sleeping state for a specified period of time, after which it enters to the ________ state.

A) ready, running
B) running, ready
C) running, blocked
D) waiting, ready
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
9
Many operating systems require ________ instructions to share resources than they do to initialize them, so in these systems, thread creation is ________ than process creation.

A) more, faster
B) more, slower
C) fewer, faster
D) fewer, slower
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
10
Which of the following statements about thread operations is true?

A) When a thread joins another thread, the former does not execute until the latter terminates.
B) Thread cancellation always terminates the target thread immediately.
C) A thread can mask an abort signal.
D) A process can continue execution after its primary thread exits.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
11
User-level thread implementations are also called ________ thread mappings.

A) one-to-one
B) one-to-many
C) many-to-one
D) many-to-many
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
12
Threads in user space can be more appropriate than kernel threads because ________.

A) user-level threads do not require the operating system to support threads.
B) application developers can tune the threading library's scheduling algorithm to meet the needs of specific applications.
C) user-level threads do not invoke the kernel for synchronization, which can reduce overhead.
D) all of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
13
Kernel-level threads are often described as ________ thread mappings.

A) one-to-one
B) one-to-many
C) many-to-one
D) many-to-many
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
14
Which of the following statements about kernel-level threads is false?

A) The kernel can manage each of a process's threads individually.
B) A process that uses kernel-level threads often can adjust the level of service each thread receives from the operating system.
C) Software that employs kernel-level threads often is more portable than software that employs user-level threads.
D) Kernel-level threads require the operating system to manage all threads in the system.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
15
The amount of overhead incurred by many-to-many thread mappings that implement thread pooling is _________ the amount of overhead incurred by one-to-one mappings.

A) greater than
B) less than
C) the same as
D) unrelated to
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
16
Which of the following statements about scheduler activations is false?

A) A scheduler activation executes the process's user-level threading-library initialization code.
B) A scheduler activation is a user thread that can notify a kernel-level threading library of events.
C) A scheduler activation creates threads and requests additional processors for its threads, if necessary.
D) An additional scheduler activation is created for each processor allocated to a process.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
17
In which of the following events would the operating system send a synchronous signal?

A) when an I/O operation completes
B) when the operating system suspends a process
C) when a process or thread performs an illegal memory operation
D) when the operating system continues a process
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
18
According to the POSIX specification, processes send signals by specifying a ________.

A) thread identifier
B) process identifier
C) pointer to a process control block
D) any of the above are allowed
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
19
What could cause a thread to terminate prematurely?

A) an exception (such an illegal memory reference)
B) a cancellation signal from a process or thread
C) both a and b
D) neither a nor b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
20
A POSIX thread that defers cancellation ________.

A) can be terminated at any point during its execution
B) will not be cancelled until it explicitly checks for a cancellation request
C) is not notified when a cancellation operation has been requested
D) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
21
According to the POSIX threading API, processor registers, a stack and a signal mask are ________.

A) maintained individually for each thread in a process
B) shared between all threads in a process
C) shared between some threads in a process
D) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
22
In Linux, what is the difference between the fork and clone system calls?

A) clone accepts arguments that specify which resources to share with the spawned process.
B) Linux responds to the clone system call by creating a new task that contains a copy of all of its parent's resources.
C) clone creates a copy of the calling task, and the copy becomes the parent of the task that issued the clone system call.
D) fork and clone spawn child processes in exactly the same way.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
23
In Linux, a process in the ________ state has been terminated but has not yet been removed from the system.

A) sleeping
B) blocked
C) zombie
D) dead
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following statements about Windows XP threads is false?

A) Threads are the primary unit of execution in Windows XP.
B) Threads execute a portion of a process's code in the process's context.
C) Each thread contains its own execution context.
D) Each thread belonging to a process is assigned a unique virtual address space.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
25
In Windows XP, a fiber is scheduled for execution ________.

A) by the thread that creates it
B) by the operating system's scheduler
C) by the process
D) none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
26
The size of a thread pool in Windows XP is ________.

A) constant and specified by the programmer for each process
B) constant for all processes on a system
C) variable, modified by the system in response to the volume of requests
D) all of the above are possible
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
27
In Windows XP, a thread enters the ________ state when the thread's requested data is currently unavailable, but the thread is otherwise ready to execute.

A) standby
B) transition
C) waiting
D) unknown
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
28
In Java, the ________ method of the Thread class contains the code that performs the "real work" of a thread.

A) run
B) start
C) go
D) main
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
29
Java implements thread signaling using the ________ method of the Thread class.

A) alert
B) signal
C) interrupt
D) wake
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 29 في هذه المجموعة.