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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a1bb0c0c18c89737 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-14 16:05:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.ops.asp.att.net.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: On-Screen Elapsed Time Display? References: <7NGq9.19522$T_.457776@iad-read.news.verio.net> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51.ops.asp.att.net 1034636709 12.234.13.56 (Mon, 14 Oct 2002 23:05:09 GMT) NNTP-Posting-Date: Mon, 14 Oct 2002 23:05:09 GMT Organization: AT&T Broadband Date: Mon, 14 Oct 2002 23:05:09 GMT Xref: archiver1.google.com comp.lang.ada:29781 Date: 2002-10-14T23:05:09+00:00 List-Id: Some comments: Look into using a "protected type" instead of semaphores. It may be more efficient and it's certainly safer. For instance, consider what would happen in your program if Set_Time_Window(Time_String); raised, but didn't handle, an exception. Area.Time is a variable accessed by two different tasks. Could that cause any problems, say if one task updated Area.Time in the middle of the other task's usage of it? Possibly access to Area.Time also needs to be controlled via a protected type. You said Set_Time_Window updates the screen with the new time. What then does Update_Screen do? It's a good idea to have the "single file" sections as short as possible. Every place your program writes to the screen will have to be surrounded by semaphores (or use the protected type). It's simpler, and less prone to error, if the synchronization is done inside the write-to-screen routines, rather than by each of their callers.