From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,651d9b748faab5c6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 04 Aug 2005 12:37:26 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Newbie: Code isn't executed References: <42f22d52$1_1@glkas0286.greenlnk.net> X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 04 Aug 2005 12:37:26 -0500 NNTP-Posting-Host: 24.6.143.98 X-Trace: sv3-ERyjmzXAG5C0jjXv/VIqVh48g8uyVDkeli01/PEJKmK1PoebwXNhqbnWqazODv0f5mCYq4loVsvmKAZ!JVB0UEsOKIHnFGPaoiIr9lFI6l8DQLo0w9iBHAlCVPm6cngMu8IBS1DKMDKl2bxsl5HweMIaGbU= X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3967 Date: 2005-08-04T12:37:26-05:00 List-Id: >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.