Create Test
Quiz logo

2

Created on 10th January 2025

Play

Grade level: Grade 12th grade

Play

0 plays

Questions

21 Questions

No Description

Questions (21)

1. What is the primary purpose of multithreading in Python?

To allow the execution of multiple threads concurrently

4 choice options

2. Which module in Python is commonly used for multithreading?

threading

4 choice options

3. What does the 'join()' method do in Python threading?

It waits for a thread to finish its execution

4 choice options

4. What is the difference between a thread and a process in Python?

Threads share the same memory space, while processes have separate memory spaces.

4 choice options

5. Which of the following statements about the Global Interpreter Lock (GIL) in Python is true?

It prevents multiple threads from executing Python bytecode at the same time.

4 choice options

6. How can you create a new thread in Python using the threading module?

By instantiating the Thread class and calling its start() method.

4 choice options

7. What is a cyber operating system (OS)?

An OS designed for managing network security and data protection

4 choice options

8. Which of the following is a characteristic of a cyber operating system?

Enhanced security features

4 choice options

9. What is the role of the kernel in an operating system?

To manage hardware and software resources

4 choice options

10. Which of the following Python features is primarily used for executing tasks concurrently?

Multithreading

4 choice options

11. What is thread safety in programming?

It refers to code that can be safely executed by multiple threads simultaneously.

4 choice options

12. What is the purpose of the 'lock' object in Python threading?

To prevent multiple threads from accessing shared resources simultaneously

4 choice options

13. In Python, which of the following is a method to start a thread?

start()

4 choice options

14. Which function can be used to check if a thread is alive in Python?

is_alive()

4 choice options

15. Which of the following is NOT a benefit of using multithreading?

Simplified code structure

4 choice options

16. What is the purpose of the 'with' statement when using locks in Python?

To ensure that locks are released automatically

4 choice options

17. Which of the following operating systems is known for its focus on security?

Qubes OS

4 choice options

18. What is the main function of an operating system?

To manage hardware and software resources

4 choice options

19. Which Python feature allows for asynchronous programming?

async/await

4 choice options

20. What is a deadlock in multithreading?

A situation where two or more threads are waiting for each other to release resources

4 choice options

21. Which statement about Python's GIL is true?

It can lead to performance bottlenecks in CPU-bound programs.

4 choice options