Pregunta de entrevista de Microsoft

What is mutex lock , semaphore ? Write the code for solving dining philosophers problem using locks.