1. Home
  2. Explore
  3. Computer Science
  4. Threads Lecture Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Threads Lecture Overview

  • 20Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Thread Basics
A thread is a lightweight unit of execution that belongs to a
and can run concurrently within it.

20 questions

  1. 1
    A thread is a lightweight unit of execution that belongs to a
    _____
    and can run concurrently within it.
    Hint

    Think of a larger container that owns resources like code, data, and files.

    Answer

    process

  2. 2
    Threads are used to perform multiple tasks simultaneously, improving responsiveness; for example, a game might use a thread for keyboard input and another for
    _____
    .
    Hint

    Consider tasks that run in parallel, like rendering or display updates.

    Answer

    updating the screen

  3. 3
    Threads benefit from hardware advances such as
    _____
    or multiprocessor systems, allowing parallel execution.
    Hint

    Multiple processing units that can execute threads simultaneously.

    Answer

    multi-core

  4. 4
    Compared to processes, threads are less resource-heavy because they can share code, data, and
    _____
    within the same process.
    Hint

    Think of resources that are not duplicated when a thread is created.

    Answer

    files

  5. 5
    Inter-process communication often requires message passing, which adds overhead, but threads can share resources directly because they belong to the same
    _____
    .
    Hint

    Same container that owns the memory and other resources.

    Answer

    process

  6. 6
    A thread is specifically not a process because a process has its own code, data, and files, while a thread is a
    _____
    of a process that can run multiple pieces of code simultaneously.
    Hint

    Consider the relationship: a thread is contained within a larger entity.

    Answer

    part

  7. 7
    Programmers face challenges when implementing threads, such as synchronization, deadlocks, and
    _____
    conditions.
    Hint

    A situation where the outcome depends on the timing of thread execution.

    Answer

    race

  8. 8
    In
    _____
    execution, the system performs more than one task at the exact same instant, typically on multicore systems.
    Hint

    Opposite of sequential execution; multiple tasks happen simultaneously.

    Answer

    parallel

  9. 9
    Concurrency involves multiple tasks making progress over a period of time, but only
    _____
    can execute at any given moment on a single core.
    Hint

    Think of time-sharing where tasks are interleaved.

    Answer

    one

  10. 10
    Data parallelism splits
    _____
    across multiple threads to process in parallel, such as rendering different parts of an image.
    Hint

    The resource that is divided among threads.

    Answer

    data

  11. 11
    Task parallelism involves performing different
    _____
    simultaneously, such as editing and spell-checking at the same time.
    Hint

    Distinct activities or functions.

    Answer

    tasks

  12. 12
    According to Amdahl's law, the speedup from parallelization is limited by the portion of the application that must be executed
    _____
    .
    Hint

    Tasks that cannot be parallelized and must run one after another.

    Answer

    serially

  13. 13
    If an application is 75% parallel and 25% serial, doubling cores from 1 to 2 gives a speedup of about
    _____
    times (1.6, 1.75, 1.33).
    Hint

    Use Amdahl's law: Speedup = 1 / (S + (1-S)/N).

    Answer

    1.6

  14. 14
    Thread libraries such as Pthreads (POSIX), Windows threads, and Java threads provide APIs for programmers to create and manage
    _____
    .
    Hint

    The execution units that can run concurrently.

    Answer

    threads

  15. 15
    In the many-to-one thread model, many user threads are mapped to a single
    _____
    thread, which can block all if any thread performs a blocking operation.
    Hint

    The thread managed by the operating system.

    Answer

    kernel

  16. 16
    Windows and Linux use the one-to-one thread model, where each user thread maps to exactly one
    _____
    thread.
    Hint

    The operating system-level thread that can run in parallel.

    Answer

    kernel

  17. 17
    The two-level thread model combines many-to-many with the ability to
    _____
    a user thread to a specific kernel thread for dedicated handling.
    Hint

    A term similar to attaching or assigning.

    Answer

    bind

  18. 18
    In Windows, the thread context is managed by an executive thread that points to a kernel thread, which points to the actual user thread; the set of registers and stack is called the thread
    _____
    .
    Hint

    The state information needed to resume a thread.

    Answer

    context

  19. 19
    Linux treats threads as tasks and uses the
    _____
    system call to create a new thread, allowing selective sharing of resources like memory and files.
    Hint

    Name of the system call that creates a new task with shared resources.

    Answer

    clone

  20. 20
    A system call is how a user process requests a service from the
    _____
    system, such as file I/O or thread creation.
    Hint

    The software that manages hardware and provides services.

    Answer

    operating

1 of 20
Question 1 of 20

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent