Which mechanism is used to prevent multiple threads from accessing shared resources simultaneously?
- Encapsulation
- Inheritance
- Mutex
- Polymorphism
The mutex (mutual exclusion) mechanism is employed to prevent multiple threads from simultaneously accessing shared resources, ensuring that only one thread can access the resource at a time, thus avoiding conflicts and data corruption.
Loading...
Related Quiz
- Which ACID property ensures that transactions maintain consistency in the database?
- Which protocol is responsible for resolving domain names to IP addresses?
- You're developing a system where user input needs to be validated against a predefined list of acceptable values. How would you use arrays or strings to handle this validation effectively?
- What are the key characteristics of the Iterative and Incremental SDLC model?
- Your team needs to revert a recent commit due to a critical bug. Explain the steps you would take to revert the commit safely using Git.