Python Concurrency and Parallelism
Python Concurrency and Parallelism - Important Points
1. | What is Concurrency in Python? |
---|
A. It is the execution of multiple threads simultaneously.
B. It is the execution of multiple processes simultaneously.
C. It is the execution of a single thread in multiple ways.
D. None of the above.
View Answer Discuss Work SpaceAnswer: option a
Explanation:
Concurrency in Python is the execution of multiple threads simultaneously.
2. | What is Parallelism in Python? |
---|
A. It is the execution of multiple threads simultaneously.
B. It is the execution of multiple processes simultaneously.
C. It is the execution of a single thread in multiple ways.
D. None of the above.
View Answer Discuss Work SpaceAnswer: option b
Explanation:
3. | Which module is used to create and manage threads in Python? |
---|
A. threading
B. multiprocessing
C. concurrent.futures
D. asyncio
View Answer Discuss Work SpaceAnswer: option a
Explanation:
4. | Which module is used to create and manage processes in Python? |
---|
A. threading
B. multiprocessing
C. concurrent.futures
D. asyncio
View Answer Discuss Work SpaceAnswer: option b
Explanation:
5. | Which of the following statements is true regarding Global Interpreter Lock (GIL)? |
---|
A. It allows multiple threads to execute simultaneously.
B. It allows multiple processes to execute simultaneously.
C. It allows only one thread to execute at a time.
D. It allows only one process to execute at a time.
View Answer Discuss Work SpaceAnswer: option c
Explanation: