Author Topic: Dining Philosophers  (Read 354 times)

AW

  • Member
  • *****
  • Posts: 1393
  • Let's Make ASM Great Again!
Dining Philosophers
« on: May 19, 2018, 01:15:38 AM »
This is the MASM version of the known Dining Philosophers problem.
https://en.wikipedia.org/wiki/Dining_philosophers_problem
https://www.slideshare.net/YashMittal3/dining-philosophers-problem

Note that this version is not set to terminate, in order to keep it faithful to its original spirit, so you must press CTRL-C when don't want more.



« Last Edit: May 19, 2018, 04:11:28 AM by aw27 »

dedndave

  • Member
  • *****
  • Posts: 8801
  • Still using Abacus 2.0
    • DednDave
Re: Dining Philosophers
« Reply #1 on: May 19, 2018, 05:31:47 AM »
i would use a finite state machine   :t

zedd151

  • Member
  • ****
  • Posts: 847
Re: Dining Philosophers
« Reply #2 on: May 19, 2018, 05:49:21 AM »
i would use a finite state machine   :t

[off topic]

There's Dave! Long time no see.

[on topic]

Just to keep with the topic, and sound like a bot:

I agree.   :biggrin:
I'm not always the sharpest knife in the drawer, but I have my moments.  :P

daydreamer

  • Member
  • ***
  • Posts: 492
Re: Dining Philosophers
« Reply #3 on: May 19, 2018, 08:35:18 AM »
nice :t
@Dave
nonworking CTRL-C and it turns into infinite state machine  :lol:
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

felipe

  • Member
  • ****
  • Posts: 895
  • Eagles are just great!
Re: Dining Philosophers
« Reply #4 on: May 19, 2018, 12:17:59 PM »
This is really cool. I think you can use this kind of programs to make some gambling programs. You will need to set some limit (like when 1 philosopher has eated all his food). So people can bet who finish first... :idea:
Felipe.

AW

  • Member
  • *****
  • Posts: 1393
  • Let's Make ASM Great Again!
Re: Dining Philosophers
« Reply #5 on: May 19, 2018, 03:47:53 PM »
i would use a finite state machine   :t
It is an implementation of a FSM, it has to to be.
It is also an implementation of a flowchart and an implementation of some pseudo code that is not there.  :t
« Last Edit: May 19, 2018, 09:11:44 PM by aw27 »

AW

  • Member
  • *****
  • Posts: 1393
  • Let's Make ASM Great Again!
Re: Dining Philosophers
« Reply #6 on: May 19, 2018, 03:50:25 PM »
nice :t
nonworking CTRL-C and it turns into infinite state machine  :lol:
You must press the power button if everything else fails.  :idea:

AW

  • Member
  • *****
  • Posts: 1393
  • Let's Make ASM Great Again!
Re: Dining Philosophers
« Reply #7 on: May 19, 2018, 03:53:32 PM »
This is really cool. I think you can use this kind of programs to make some gambling programs. You will need to set some limit (like when 1 philosopher has eated all his food). So people can bet who finish first... :idea:

The window is open for all sorts of adventures.  :biggrin: