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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.unit0.net!peer02.am4!peer.am4.highwinds-media.com!peer03.fr7!futter-mich.highwinds-media.com!news.highwinds-media.com!fx13.am4.POSTED!not-for-mail From: Spiros Bousbouras Newsgroups: comp.lang.ada Subject: Re: Large number of tasks slows down my program (using debian) - any fix? References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> <9377f941-31d0-4260-818a-8e189aac8c19@googlegroups.com> <10e74e0c-119a-4d86-8a12-c05101f744f1@googlegroups.com> In-Reply-To: X-Organisation: Weyland-Yutani Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <9SuxC.486056$Ly1.401636@fx13.am4> X-Complaints-To: http://netreport.virginmedia.com NNTP-Posting-Date: Thu, 05 Apr 2018 19:33:25 UTC Organization: virginmedia.com Date: Thu, 05 Apr 2018 19:33:25 GMT X-Received-Bytes: 1888 X-Received-Body-CRC: 2450065284 Xref: reader02.eternal-september.org comp.lang.ada:51343 Date: 2018-04-05T19:33:25+00:00 List-Id: On Thu, 5 Apr 2018 17:30:38 +0200 "Jeffrey R. Carter" wrote: > 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? It seems so to me but I think the point is to see how long it will take rather than get an answer. Actually the fact that you can calculate the answer easily by hand is a good thing because it gives you a quick test to see if the programme or the implementation has a bug. Now the ideal compiler would be one which can prove that the answer will always be 291 and produce code which does nothing more that print this answer !