menu

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.

Discuss Work Space

Answer: 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.

Discuss Work Space

Answer: option b

Explanation:

Parallelism in Python is the execution of multiple processes simultaneously.

3. Which module is used to create and manage threads in Python?

A. threading

B. multiprocessing

C. concurrent.futures

D. asyncio

Discuss Work Space

Answer: option a

Explanation:

The "threading" module is used to create and manage threads in Python.

4. Which module is used to create and manage processes in Python?

A. threading

B. multiprocessing

C. concurrent.futures

D. asyncio

Discuss Work Space

Answer: option b

Explanation:

The "multiprocessing" module is used to create and manage processes in Python.

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.

Discuss Work Space

Answer: option c

Explanation:

The Global Interpreter Lock (GIL) in Python allows only one thread to execute at a time.


Subscribe for Latest Career Trends
Subscribe Now
Use AI and ChatGPT for Career Guidance

Unlock Your Future

Join Now
Worried for Placements in 2024?

Join FAST TRACK Course

Join Now
Supercharge Your SUCCESS

Join All in One Placement Mock Tests-2024

Join Now