In computer science, a semaphore is a variable or abstract data type used to control access to a common resource by multiple threads. Semaphores are a type of synchronization primitives. The concept was invented by Dutch computer scientist Edsger Dijkstra in 1962.