Re: Regarding Cigarette Smoker's problem

"Richard O'Keefe" <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CABcYAd+SRdCRysM4z8uGsyw-rwUR2VRB7OmahDWzPMzWkJMVgA@mail.gmail.com>
Did you try a web search for
Cigarette Smokers problem solved in Erlang
If not, why not?

One fairly obvious approach is for the smokers
to register themselves, one as 'tobacco', one as
'paper', and one as 'matches'.
Then
  arbiter() ->
     select a random element of [tobacco,paper,matches] as Who,
     Who!go,
     arbiter().

Another approach would be for the smokers to register
themselves with the arbiter in a startup phase.

Let me put it this way.
Try to make your code so simple and obvious that it
is hard to get wrong.
Then find the mistakes.

On Mon, 9 Nov 2020 at 21:16, AshiSh Kulkarni <[email protected]> wrote:

> Hello,
> I am new to erlang. And I  am trying to implement the Cigarette Smoker's
> Problem In Erlang,but i'm having some errors. So if anybody has already
> implemented the code in erlang, plz can you mail me ASAP.
>
> Thank You.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.