standard solution for philosopher problem