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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: A question about task's select delay alternative Date: Mon, 23 Apr 2018 20:06:26 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 23 Apr 2018 18:06:27 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="a4d69bd33244f804ccdfcf18cbb7db12"; logging-data="3844"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19SW5yBltHdnPGAgGMjSGeB08WxtVKO8lE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:AjZOFXNjaFImK99LYLxlbVaY2Q0= Xref: reader02.eternal-september.org comp.lang.ada:51685 Date: 2018-04-23T20:06:26+02:00 List-Id: On 04/23/2018 07:32 PM, NiGHTS wrote: > > What does "delay" actually do to the CPU? In this case I am using the Adacore GNAT compiler for a PC. Is it a loop constantly evaluating elapsed time? Or is it some kind of timed interrupt? What timed selective accept "does to the CPU" is not defined by the language. It's determined by the compiler implementation and, probably, by the features of the OS, if any. So there's no Ada answer to your question. I don't know how GNAT implements this, but my experience with it is that blocked tasks don't use significant CPU. You can test this easily enough. Why do you care? -- Jeff Carter "When danger reared its ugly head, he bravely turned his tail and fled." Monty Python and the Holy Grail 60