comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: Newbie: Code isn't executed
Date: Thu, 04 Aug 2005 12:37:26 -0500
Date: 2005-08-04T12:37:26-05:00	[thread overview]
Message-ID: <Ht6dndDMFPbLz2_fRVn-uQ@comcast.com> (raw)
In-Reply-To: 42f22d52$1_1@glkas0286.greenlnk.net

>Also, sharing Total between the tasks is poor, it should be a protected
>object.
  Worse, suppose Peter checks Total while Susan is dining with Michael.
Peter finds Total = 1 so he tries to rendezvous with Susan.  But Susan,
on returning from dinner, decrements Total, finds it to be zero,
prints statistics, and goes away.  Leaving poor Peter still trying to
rendezvous.
  You need a way for Peter and Michael to tell that Susan has gone away
and they should stop calling.  Anything that involves "find out if Susan
is taking calls, and if so call her" will fail if she leaves in the
interval between test and call.  Since dinner is a time-limited event,
they could use a select with timeout.  If she hasn't responded within a
reasonable time, they can give up.



  reply	other threads:[~2005-08-04 17:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-04 14:10 Newbie: Code isn't executed Thomas Ruschival
2005-08-04 14:47 ` Ed Falis
2005-08-04 14:48 ` Egil Høvik
2005-08-04 15:07 ` Martin Dowie
2005-08-04 17:37   ` tmoran [this message]
2005-08-04 20:57     ` Randy Brukardt
2005-08-05  6:11       ` Vinzent 'Gadget' Hoefler
2005-08-06  3:52         ` tmoran
2005-08-04 20:20   ` Simon Wright
2005-08-04 15:09 ` Martin Dowie
2005-08-04 16:37 ` SOLVED: " Thomas Ruschival
2005-08-05  2:43 ` Steve
2005-08-06  5:33   ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox