Midterm - Quiz 3

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Carlo B.
C
Carlo B.
Community Contributor
Quizzes Created: 1 | Total Attempts: 107
Questions: 13 | Attempts: 107

SettingsSettingsSettings
Midterm - Quiz 3 - Quiz

.


Questions and Answers
  • 1. 

    One of the challenges in multicore programming is dividing accessed and manipulated by tasks to run on seperate cores. This area is called: ________.

    Explanation
    The given correct answer for this question is "DATA SPLITTING". In multicore programming, one of the challenges is dividing the data that is accessed and manipulated by tasks to run on separate cores. This process is known as data splitting. By dividing the data, each core can work on a portion of the data simultaneously, improving performance and efficiency in multicore systems.

    Rate this question:

  • 2. 

    There are three models of multithreading: one-to-many, one-to-one and many-to-many. 

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because there are actually two models of multithreading, not three. The two models are one-to-one and many-to-many. The one-to-many model does not exist in multithreading.

    Rate this question:

  • 3. 

    There are two techniques for creating threads in a lava program. One approach is to create a new class that is derived from the Thread class and to override its run() method, An alternative and more commonly used technique is to define  a class that implements the Runnable interface.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The given answer is true because the explanation provided states that there are two techniques for creating threads in a Java program - one is by creating a new class derived from the Thread class and overriding its run() method, and the other is by defining a class that implements the Runnable interface. This implies that it is indeed true that there are two techniques for creating threads in a Java program.

    Rate this question:

  • 4. 

    Whereas creating a seperate thread is certainly superior to creating a seperate process, a multithreaded server nonetheless has potential problems. The first issue concerns the amount of time required to create the thread, The second issue concerns the number of threads concurrently active in the system. Unlimited threads could exhaust system resources, such as cpu time or memory. One solution to this problem is to use a ________

    Correct Answer
    THREAD POOL
    Explanation
    A thread pool is a solution to the potential problems of creating and managing multiple threads in a multithreaded server. Instead of creating a new thread for each request, a thread pool allows for the reuse of existing threads. This reduces the overhead of thread creation and destruction, improving performance. Additionally, a thread pool can limit the number of concurrent threads, preventing the exhaustion of system resources. By efficiently managing the allocation and reuse of threads, a thread pool helps optimize the performance and stability of a multithreaded server.

    Rate this question:

  • 5. 

    A ________ provides the programmer with an api for creating and managing threads.

    Correct Answer
    THREAD LIBRARY
    Explanation
    A thread library is a software component that provides a programmer with an API (Application Programming Interface) for creating and managing threads. It includes functions and methods that allow the programmer to create, start, pause, resume, and terminate threads, as well as perform other operations such as synchronization and communication between threads. The thread library abstracts the underlying operating system's thread management capabilities and provides a higher-level interface for the programmer to work with threads.

    Rate this question:

  • 6. 

    User threads are supported above the kernel and managed with kernel support, whereas kernel threads are supported and managed directly by the operating system.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    User threads are supported and managed directly by the operating system, whereas kernel threads are supported above the kernel and managed with kernel support. This means that kernel threads have direct access to the operating system's resources and can execute in parallel, while user threads rely on the support of the operating system's kernel to manage their execution. Therefore, the correct answer is False.

    Rate this question:

  • 7. 

    Many systems implementing either the many-to-many of the two-level model place an intermediate data structure between the user and kernel threads. This data structure is typically known as ________.

    Correct Answer
    LIGHTWEIGHT PROCESS
    Explanation
    In systems implementing the many-to-many or two-level model, there is often a need for an intermediate data structure between the user and kernel threads. This data structure, known as a lightweight process, helps facilitate communication and coordination between the two levels. It provides a layer of abstraction and allows for efficient scheduling and management of threads.

    Rate this question:

  • 8. 

    A ________ is used in unix systems to notify a process that a particular event has occured.

    Correct Answer
    SIGNAL
    Explanation
    In Unix systems, a signal is used to notify a process that a particular event has occurred. Signals are a way for processes to communicate with each other and can be used to interrupt a process, terminate a process, or notify a process of an event such as a user input or a hardware interrupt. By sending a signal, one process can inform another process about a specific event, allowing for synchronization and coordination between processes in the Unix system.

    Rate this question:

  • 9. 

    ________ involves terminating a thread before it has completed. For example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be terminated. Another situation might occur when a user presses a button on a web browser that stops a web page from loading any further. A thread that is to be terminated is often referred to as the ________

    Correct Answer
    THREAD CANCELLATION
    TARGET THREAD
    Explanation
    Thread cancellation involves terminating a thread before it has completed. For example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be terminated. Another situation might occur when a user presses a button on a web browser that stops a web page from loading any further. A thread that is to be terminated is often referred to as the target thread.

    Rate this question:

  • 10. 

    In general, kernel-level threads are faster to create and to manage the user-level threads, because of the kernel's effective intervention.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Kernel-level threads are not necessarily faster to create and manage than user-level threads. The speed of creating and managing threads depends on various factors, including the implementation of the operating system and the specific requirements of the application. While kernel-level threads may have the advantage of the kernel's effective intervention, user-level threads can also be efficiently created and managed by the user-level thread library without the need for kernel intervention. Therefore, the statement that kernel-level threads are faster to create and manage than user-level threads is false.

    Rate this question:

  • 11. 

    PThreads is an implementation, not a specification.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    pThreads is actually a specification, not just an implementation. It stands for "POSIX Threads" and refers to a set of standard APIs (Application Programming Interfaces) for creating and manipulating threads in a multi-threaded program. It provides a standardized way for developers to work with threads on POSIX-compliant operating systems. Various implementations of pThreads exist, such as the one provided by the GNU C Library (glibc), but the specification itself defines the behavior and functionality of the threading interface. Therefore, the correct answer is False.

    Rate this question:

  • 12. 

    There are two tpes of parallelism: ________ and ________ . The former focuses on distributing substes of the same data across multiple computing cores and performing the same operation on each core. Whereas the latter distributes threads across multiple computing cores.

    Correct Answer
    DATA PARALLELISM
    TASK PARALLELISM
    Explanation
    The correct answer is DATA PARALLELISM and TASK PARALLELISM. Data parallelism refers to distributing subsets of the same data across multiple computing cores and performing the same operation on each core. Task parallelism, on the other hand, involves distributing threads across multiple computing cores.

    Rate this question:

  • 13. 

    Linux does not distinguish between processes and threads

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    Linux does not distinguish between processes and threads. This means that in Linux, both processes and threads are treated as the same entity. They share the same resources and have the same level of access to the system. This is in contrast to some other operating systems where processes and threads are treated as separate entities with different levels of access and resource allocation. In Linux, this lack of distinction allows for more efficient resource utilization and easier communication between processes and threads.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 15, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 21, 2019
    Quiz Created by
    Carlo B.
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.