Knowledge check

Multiple choice, single answer

Why do CPU-bound Python threads usually fail to scale a pure-Python loop?

  • A) Threads cannot share memory

  • B) The GIL normally permits only one thread to execute Python bytecode at a time

  • C) Every thread runs on a different node

  • D) Python threads cannot call functions

Which workload is the strongest initial Cython candidate?

  • A) A measured, stable numerical Python loop

  • B) Waiting for 500 network responses

  • C) A 2 ms pandas operation

  • D) A task already dominated by an optimized BLAS call

What does a Dask delayed call do before compute()?

  • A) Runs immediately in a new process

  • B) Compiles the function to C

  • C) Adds lazy work to a task graph

  • D) Copies the entire dataset

Which local scheduler is a strong candidate for CPU-heavy pure-Python tasks?

  • A) Processes

  • B) Threads only

  • C) A GPU scheduler

  • D) No scheduler can run Python

Why can threads suit the lesson’s compiled Cython kernel?

  • A) Cython disables all synchronization

  • B) Its hot loop releases the GIL and performs native work

  • C) Threads automatically vectorize Python objects

  • D) Cython always uses OpenMP

What is wrong with calling compute() inside a graph-construction loop?

  • A) It forces small executions and hides global parallelism from Dask

  • B) It changes floating-point values into integers

  • C) It requires a GPU

  • D) It creates a Cython extension

Which information is essential in a speedup claim?

  • A) Only the fastest elapsed time

  • B) Only the worker count

  • C) Fixed workload, baseline, correctness, hardware, and configuration

  • D) The name of the optimization library

Check your answers.