Sollicitatievraag bij Microsoft

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