Python3 by using Lock, beats 97.93%
Attached is my solution using Lock. \n\nI try to limit only one even philosopher can eat at the same time, so that the odd philosophers will not be blocked. Fee
Attached is my solution using Lock. \n\nI try to limit only one even philosopher can eat at the same time, so that the odd philosophers will not be blocked. Feel free to discuss.\n\n-- update, improve to 100% by removing  the even lock.\n\n``` python\n\nfrom threading import Lock\n\nclass DiningPhilosophers:\n    \n    forks = [Lock() for _ in range(5)]\n    even = Lock()\n    \n    # call the functions directly to execute, for example, eat()\n    def wantsToEat(self,\n                   philosopher: int,\n                   pickLeftFork: \'Callable[[], None]\',\n                   pickRightFork: \'Callable[[], None]\',\n                   eat: \'Callable[[], None]\',\n                   putLeftFork: \'Callable[[], None]\',\n                   putRightFork: \'Callable[[], None]\') -> None:\n        \n        i = philosopher\n        if i % 2 == 0:\n            self.even.acquire()\n            \n        right_fork = i\n        left_fork = (i+1) % 5\n        \n        self.forks[right_fork].acquire()\n        self.forks[left_fork].acquire()\n        pickRightFork()\n        pickLeftFork()\n        eat()\n        putLeftFork()\n        putRightFork()\n        self.forks[right_fork].release()\n        self.forks[left_fork].release()\n        if i % 2 == 0:\n            self.even.release()\n\n```
['Python3']