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: Large number of tasks slows down my program (using debian) - any fix? Date: Thu, 5 Apr 2018 22:25:20 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> <9377f941-31d0-4260-818a-8e189aac8c19@googlegroups.com> <10e74e0c-119a-4d86-8a12-c05101f744f1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 5 Apr 2018 20:25:20 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="18451c4f378f46f220d022120ae85f41"; logging-data="30116"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jurolJO3JhQDtthHt8NIs1VMweLnBzeY=" 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:LBSoFPFUH+fjcgJTsB13m7Cr1xA= Xref: reader02.eternal-september.org comp.lang.ada:51345 Date: 2018-04-05T22:25:20+02:00 List-Id: On 04/05/2018 09:44 PM, Simon Wright wrote: > "Jeffrey R. Carter" writes: > >> On 04/05/2018 04:07 PM, Brad Moore wrote: >>> >>> The problem there is to create 503 tasks, and then use some sort of >>> message passing to pass a "token" in a ring from from task to the >>> next, 50_000_000 times, printing out the task number that ended up >>> with the token at the end. >> >> Isn't the answer always 291? > > In the three I looked at the answer was 292. I guess it depends on where the token starts. If it starts outside the ring and is 1st passed to task 1, the answer is 291. If it starts in task 1 and is 1st passed to task 2, the answer is 292. I think. -- Jeff Carter "Sir Lancelot saves Sir Gallahad from almost certain temptation." Monty Python & the Holy Grail 69