farc icon indicating copy to clipboard operation
farc copied to clipboard

Dining Philosophers Problem deadlock, Windows Python 3.11.5

Open MiMiMeowMeow opened this issue 1 year ago • 2 comments

Hello,

Just a few issues/questions:

  1. I picked up tried to run this recently on Windows 10, Python 3.11.5. It seems to deadlock now. image

  2. Any thoughts of using coroutine and tasks? I'm thinking that version would more like the pre-emptive kernel when this on is the vanilla?

  3. Any thoughts on using a libary like Trio? I think it can handle the Windows Ctl-C issue propertly... https://trio.readthedocs.io/en/stable/

Thanks!

MiMiMeowMeow avatar Oct 30 '23 23:10 MiMiMeowMeow

Thanks for the report. I'll take a look when we get to the weekend. For now just some quick/non-final answers:

  • I'll take a look at 1. It will be interesting to see if I can recreate the issue. Timing issues are tough that way.
  • My software philosophy bends towards minimalism. The fewer lines I write, the less chance for defects. I also prefer few to no dependencies because I don't want to create a source of maintenance that is outside my control. That said, I've always felt that I didn't do async quite right with farc and I've wanted to either rewrite for single-thread concurrency or go all-in on async now that Python has better tools for it. Or both.
  • I wouldn't create a dependency just to solve Ctrl+C.

dwhall avatar Oct 31 '23 02:10 dwhall

I was easily able to recreate the issue with examples/dpp.py on Mac OS X with Python 3.11.5.

dwhall avatar Nov 22 '23 15:11 dwhall