The MASM Forum

General => The Laboratory => Topic started by: aw27 on May 19, 2018, 01:15:38 AM

Title: Dining Philosophers
Post by: aw27 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.



Title: Re: Dining Philosophers
Post by: dedndave on May 19, 2018, 05:31:47 AM
i would use a finite state machine   :t
Title: Re: Dining Philosophers
Post by: zedd151 on May 19, 2018, 05:49:21 AM
Quote from: dedndave on May 19, 2018, 05:31:47 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:
Title: Re: Dining Philosophers
Post by: daydreamer on May 19, 2018, 08:35:18 AM
nice :t
@Dave
nonworking CTRL-C and it turns into infinite state machine  :lol:
Title: Re: Dining Philosophers
Post by: felipe 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:
Title: Re: Dining Philosophers
Post by: aw27 on May 19, 2018, 03:47:53 PM
Quote from: dedndave on May 19, 2018, 05:31:47 AM
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
Title: Re: Dining Philosophers
Post by: aw27 on May 19, 2018, 03:50:25 PM
Quote from: daydreamer on May 19, 2018, 08:35:18 AM
nice :t
nonworking CTRL-C and it turns into infinite state machine  :lol:
You must press the power button if everything else fails.  :idea:
Title: Re: Dining Philosophers
Post by: aw27 on May 19, 2018, 03:53:32 PM
Quote from: felipe 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:

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