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!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: A Simpler Find Tool Date: Sun, 21 May 2017 19:22:51 +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: Sun, 21 May 2017 17:19:27 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="3775ad3b4868ca11a7e3942fbe7c1fe4"; logging-data="14593"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mz7p5bItmWVDbh242y4j8Y+2YYSaRGoU=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Cancel-Lock: sha1:83VuKKRZEgnYnEiCSHtSP5RCQ+0= Xref: news.eternal-september.org comp.lang.ada:46837 Date: 2017-05-21T19:22:51+02:00 List-Id: On 05/21/2017 07:04 AM, Brian Kolden wrote: > > I'm using a request and reserve model to determine which threads are waiting > and which are busy. The threads call End_Thread when they finish their work > in order to be available to be queued again. I think the model itself is > good, but I was unhappy with how I find the sleeping threads. Does anyone > have a cleaner suggestion? This feels backward to me. In Ada, tasks schedule themselves, so it seems more natural for the task to wait until there's work to do and then do it than for the work to look for an available task. I'd suggest you replace your task pool with an instance of PragmARC.Job_Pools. The PragmAda Reusable Components are available from https://pragmada.x10hosting.com/ and https://github.com/jrcarter/PragmARC -- Jeff Carter "I soiled my armor, I was so scared." Monty Python & the Holy Grail 71