Question d’entretien chez Microsoft

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