1. Home
  2. Explore
  3. Computer Science
  4. Parallel Computing

Study methods

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

Parallel Computing

  • 52Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Parallel Computing
If one person completes a job in 10 days, 10 people working in parallel can complete it in
day.

52 questions

  1. 1
    If one person completes a job in 10 days, 10 people working in parallel can complete it in
    _____
    day.
    Hint

    Divide the total work among 10 people, each doing one-tenth.

    Answer

    1

  2. 2
    In computer systems, parallelization improves application performance by dividing a large job among multiple
    _____
    that work at the same time.
    Hint

    These entities each perform a small portion of the larger job.

    Answer

    computing entities

  3. 3
    A GPU, or Graphics processing unit, can perform
    _____
    of tasks in parallel.
    Hint

    The content describes a very large number of simultaneous tasks.

    Answer

    thousands

  4. 4
    A parallelizable job is split into smaller tasks so that their results can be combined to complete the
    _____
    job more quickly.
    Hint

    The smaller tasks are portions of the original task.

    Answer

    larger

  5. 5
    In the example program, the add all function calculates the sum of the first
    _____
    positive integers.
    Hint

    The program repeatedly adds numbers from the beginning of the range to its upper limit.

    Answer

    10 million

  6. 6
    When a single-threaded process is scheduled on a system with four processors, it generally runs on
    _____
    processor at a time.
    Hint

    The process in the example has only one execution context.

    Answer

    one

  7. 7
    Dividing 10 million numbers evenly among four workers gives each worker
    _____
    numbers to process.
    Hint

    Split the total number of values into four equal portions.

    Answer

    2.5 million

  8. 8
    With four processors and four equal, parallel portions of the example job, the expected completion time is about
    _____
    times faster than sequential execution.
    Hint

    Each processor handles one of four equal parts.

    Answer

    four

  9. 9
    The operating system's
    _____
    selects a process and assigns it to a processor for execution.
    Hint

    This operating-system component chooses what runs on available processors.

    Answer

    scheduler

  10. 10
    In the four-process approach, each process sums a different
    _____
    of the number range.
    Hint

    Each process works on one of four equal parts.

    Answer

    quarter

  11. 11
    Creating four separate processes for the four portions requires four
    _____
    system calls.
    Hint

    This system call creates a process.

    Answer

    fork

  12. 12
    A process is an isolated execution entity with its own instructions, data, heap, and
    _____
    .
    Hint

    This memory segment stores function-call information and local variables.

    Answer

    stack

  13. 13
    Because separate processes are isolated, they need
    _____
    techniques to communicate with one another.
    Hint

    The term is often abbreviated IPC.

    Answer

    inter-process communication

  14. 14
    One IPC method uses operating-system-supported
    _____
    and receive system calls to pass messages between processes.
    Hint

    This call is paired with receive in message-passing IPC.

    Answer

    send

  15. 15
    Another IPC method creates a memory region that multiple processes can use, called
    _____
    memory.
    Hint

    The name describes memory made accessible to more than one process.

    Answer

    shared

  16. 16
    Process management operations such as creation, destruction, and file operations are performed through
    _____
    .
    Hint

    These requests transfer control to the operating system.

    Answer

    system calls

  17. 17
    When a process invokes a system call, a software
    _____
    triggers execution of the operating system.
    Hint

    This mechanism transfers control from the running program to the operating system.

    Answer

    trap

  18. 18
    After a software trap, the operating system determines which system call was requested and runs the corresponding system call
    _____
    .
    Hint

    This component carries out the requested operation.

    Answer

    handler

  19. 19
    Using multiple processes for similar tasks duplicates some instructions and
    _____
    across the processes.
    Hint

    The example notes that processes can access the same global information and arrays.

    Answer

    data

  20. 20
    In the example, each of the four processes independently computes the sum of
    _____
    numbers.
    Hint

    This is one quarter of the 10-million-number range.

    Answer

    2.5 million

  21. 21
    Compared with the threaded approach, the multiple-process approach involves more system calls and therefore greater
    _____
    .
    Hint

    These costs make an approach less efficient.

    Answer

    overheads

  22. 22
    Threading reduces parallelization overhead by using one process with multiple
    _____
    instead of multiple processes.
    Hint

    These are lightweight execution entities within a process.

    Answer

    threads

  23. 23
    A thread is an execution entity that is similar to a process but is considered an extremely lightweight
    _____
    .
    Hint

    The content compares threads directly with this type of execution entity.

    Answer

    process

  24. 24
    In the four-thread example, all threads execute within
    _____
    process.
    Hint

    The approach creates a single process and then adds multiple execution contexts inside it.

    Answer

    one

  25. 25
    Threads in the same process share its code, global data, heap, and open
    _____
    .
    Hint

    These are resources opened by the process and available to its threads.

    Answer

    files

  26. 26
    Unlike shared process segments, each thread has its own
    _____
    for local variables and function-call information.
    Hint

    This per-thread memory area supports that thread's function calls.

    Answer

    stack

  27. 27
    A thread's own stack helps distinguish its execution context from other threads in the same
    _____
    .
    Hint

    The threads share this entity's code and heap.

    Answer

    process

  28. 28
    Each thread's execution context includes register values such as the EIP and
    _____
    registers.
    Hint

    The content names this register alongside EIP.

    Answer

    ESP

  29. 29
    A thread can be scheduled on a processor different from the one running another thread, or multiple threads can share one processor at different
    _____
    .
    Hint

    The content contrasts simultaneous processor use with taking turns.

    Answer

    time instances

  30. 30
    During a context switch, a thread's register values help the system stop and later
    _____
    the thread.
    Hint

    The saved execution state allows work to continue later.

    Answer

    restart

  31. 31
    In the threaded example, each thread handles a different portion containing
    _____
    numbers.
    Hint

    Four equal portions divide the 10-million-number task.

    Answer

    2.5 million

  32. 32
    Creating 50,000 threads took 0.9 time units in the cited comparison, while creating 50,000 processes took
    _____
    time units on the same machine.
    Hint

    This is the larger of the two reported measurements.

    Answer

    8.1

  33. 33
    Because threads are lightweight, creating and managing them is generally more
    _____
    than creating and managing processes.
    Hint

    The comparison emphasizes lower cost and faster operations.

    Answer

    efficient

  34. 34
    Communication between threads in the same process can use shared global data or the shared
    _____
    .
    Hint

    This is another memory segment shared by the process's threads.

    Answer

    heap

  35. 35
    Unlike communication between isolated processes, communication through shared thread data can avoid many communication-related
    _____
    calls.
    Hint

    This word completes the name for operating-system service requests.

    Answer

    system

  36. 36
    Switching between threads generally requires saving less execution
    _____
    than switching between processes.
    Hint

    This includes state needed to resume execution.

    Answer

    context

  37. 37
    Switching between threads in the same process does not require changing the process's
    _____
    tables.
    Hint

    These tables map virtual memory for a process.

    Answer

    page

  38. 38
    Because thread switches keep the same page tables active, cached entries in the
    _____
    can remain valid.
    Hint

    This cache stores address-translation information.

    Answer

    TLB

  39. 39
    Process context switching can involve flushing the TLB and loading the new process's page tables, adding to the switching
    _____
    .
    Hint

    This is the extra cost associated with an operation.

    Answer

    overhead

  40. 40
    The pthread library function used to create a thread is called
    _____
    .
    Hint

    Its name combines the library prefix with the action of making a new thread.

    Answer

    pthread_create

  41. 41
    The pthread function used to exit a thread is
    _____
    .
    Hint

    Its name pairs the pthread prefix with the action of leaving execution.

    Answer

    pthread_exit

  42. 42
    The pthread function that lets one thread wait for another specific thread to finish is
    _____
    .
    Hint

    It is compared with the wait system call used with processes.

    Answer

    pthread_join

  43. 43
    In the example, the thread function receives a void pointer argument that identifies which portion of the work the thread should
    _____
    .
    Hint

    The argument helps determine which numbers belong to that thread.

    Answer

    process

  44. 44
    In the example, the four threads receive argument values 0, 1, 2, and
    _____
    .
    Hint

    The values are consecutive identifiers starting at zero.

    Answer

    3

  45. 45
    The example stores four partial sums in a global unsigned long array named
    _____
    .
    Hint

    Each thread writes its portion's result into an element of this array.

    Answer

    sum

  46. 46
    The partial sum for the first range, from 0 to 2.5 million, is stored in array element
    _____
    .
    Hint

    The first thread uses index zero for its result.

    Answer

    sum zero

  47. 47
    After all four threads finish, the program adds their partial results to compute the
    _____
    sum.
    Hint

    This is the combined result for the entire number range.

    Answer

    final

  48. 48
    To compile the example with the pthread library, the compiler command links the library using the option
    _____
    .
    Hint

    The option begins with a hyphen and the letter l.

    Answer

    -lpthread

  49. 49
    A process can continue running after one of its threads terminates, provided other threads remain
    _____
    .
    Hint

    The example describes nine remaining threads continuing after one of ten ends.

    Answer

    active

  50. 50
    If a process terminates, all threads belonging to that process also
    _____
    .
    Hint

    Threads depend on their process to exist and execute.

    Answer

    terminate

  51. 51
    The example's four thread results are combined only after the main thread's four join calls have
    _____
    .
    Hint

    The joins ensure every worker has finished before the results are used.

    Answer

    completed

  52. 52
    Besides pthreads, the content names the Windows threads library, Boost, and
    _____
    as other thread-library options.
    Hint

    This library name includes the operating system used by the example system.

    Answer

    Linux threads

1 of 52
Question 1 of 52

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent