Python Concurrency and Parallelism
Python Concurrency and Parallelism - Important Points
16. | Which of the following is an advantage of using coroutines in Python? |
---|
A. They are more efficient than threads or processes.
B. They allow for better memory management.
C. They allow for easier synchronization between tasks.
D. They allow for better handling of I/O bound tasks.
View Answer Discuss Work SpaceAnswer: option d
Explanation:
17. | Which module is used to implement parallelism in Python using GPUs? |
---|
A. multiprocessing
B. concurrent.futures
C. asyncio
D. numba
View Answer Discuss Work SpaceAnswer: option d
Explanation:
18. | Which of the following is an advantage of using concurrent.futures module in Python? |
---|
A. It allows for more efficient use of CPU resources.
B. It allows for better memory management.
C. It allows for easier synchronization between tasks.
D. It allows for better handling of I/O bound tasks.
View Answer Discuss Work SpaceAnswer: option a
Explanation:
19. | Which method is used to cancel a running task in Python? |
---|
A. cancel()
B. stop()
C. terminate()
D. kill()
View Answer Discuss Work SpaceAnswer: option a
Explanation:
20. | Which of the following is an example of a common use case for multiprocessing in Python? |
---|
A. Web scraping
B. GUI programming
C. Numerical computation
D. Database programming
View Answer Discuss Work SpaceAnswer: option c
Explanation: