Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views5 pages

Lect 12

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Lect 12

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

1. What is concurrency?

A. A type of memory
B. A bug in software
C. Things happening at the same time
D. A single process loop
Answer: C

2. Concurrency is common in:


A. Video games only
B. Real-world systems
C. Only in networks
D. Only in OS
Answer: B

3. In software, concurrency deals with:


A. Slow processing
B. Errors
C. Random events and timing
D. Graphics display
Answer: C

4. Synchronization means:
A. Shutting down a system
B. Making processes slow
C. Coordination between concurrent activities
D. Starting new threads
Answer: C

5. A common issue in concurrent systems is:


A. Power loss
B. Synchronization
C. Compilation error
D. Graphics lag
Answer: B
6. Mutual exclusion helps to:
A. Improve UI
B. Save memory
C. Avoid race conditions
D. Increase data size
Answer: C

7. Race condition happens when:


A. Only one thread runs
B. Threads wait forever
C. Multiple threads use shared resources without control
D. Data is not saved
Answer: C

8. Race conditions can cause:


A. Correct system behavior
B. Software to slow down
C. Bugs and failures
D. Data backup
Answer: C

9. What is a mutex?
A. A display tool
B. A locking tool
C. A type of memory
D. A database
Answer: B

10. Mutex is used to control:


A. Colors
B. User interface
C. Access to shared resources
D. File size
Answer: C
11. Who proposed semaphores first?
A. Alan Turing
B. Linus Torvalds
C. Edsger Dijkstra
D. Dennis Ritchie
Answer: C

12. A semaphore is:


A. A CPU unit
B. A network protocol
C. An integer variable
D. A command
Answer: C

13. Semaphore helps in:


A. Memory leak
B. Display scaling
C. Access control in threads
D. Increasing internet speed
Answer: C

14. Which two operations are supported by semaphores?


A. A() and B()
B. Go() and Stop()
C. Lock() and Free()
D. P() and V()
Answer: D

15. P() stands for:


A. Pause
B. Print
C. Pass (allow access)
D. Post
Answer: C
16. V() stands for:
A. Verify
B. View
C. Release (free access)
D. Vote
Answer: C

17. In P(S), what happens if S > 0?


A. Thread sleeps
B. Waits forever
C. S is incremented
D. S is decremented
Answer: D

18. In P(S), if S is 0 or less:


A. Thread exits
B. Thread waits
C. S is set to 10
D. Nothing happens
Answer: B

19. In V(S), if threads are waiting:


A. All get access
B. One is assigned access
C. All are blocked
D. System shuts down
Answer: B

20. If no threads are waiting in V(S):


A. S is decremented
B. S is multiplied
C. S is incremented
D. S is cleared
Answer: C
21. What is critical section?
A. Debug area
B. Shared code needing protection
C. UI design
D. Network settings
Answer: B

22. Mutual exclusion ensures:


A. All threads run together
B. Only one thread in critical section
C. No thread is blocked
D. All threads are paused
Answer: B

23. What is a common tool for synchronization?


A. printf
B. pointer
C. mutex
D. scanner

You might also like