Concept Flow - Why semaphores are needed
Task 1 wants resource
Check if resource free?
No→Wait (block)
Yes
Take resource (lock)
Use resource
Release resource (unlock)
Other waiting tasks notified
Next task takes resource
Tasks check if a resource is free; if not, they wait. When free, a task locks it, uses it, then unlocks it, allowing others to proceed.
