Questions and Answers
What is the purpose of the Global Interpreter Lock (GIL) in Python?
To ensure that only one thread executes Python bytecode at a time
Which of the following is an example of Inter-process communication (IPC)?
Shared memory
What is a potential issue that can arise when multiple threads access shared memory without proper synchronization?
Race condition
If a CPU-bound task needs to be parallelized across multiple cores, which approach should be used in Python?
Signup and view all the answers
Which of the following is a common technique used for synchronizing access to shared resources between threads?
Signup and view all the answers
What is the advantage of using multiprocessing over multithreading for CPU-bound tasks in Python?
Signup and view all the answers
What is a potential drawback of using multiprocessing compared to multithreading in Python?
Signup and view all the answers
What is the purpose of using a mutex (mutual exclusion) in multithreaded programming?
Signup and view all the answers
Which of the following is a potential issue that can arise when using shared memory for inter-process communication?
Signup and view all the answers
What is the purpose of using a semaphore in multithreaded programming?
Signup and view all the answers