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: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Large number of tasks slows down my program (using debian) - any fix? Date: Wed, 28 Mar 2018 12:06:21 -0700 Organization: A noiseless patient Spider Message-ID: <87y3ic9g0i.fsf@nightsong.com> References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: h2725194.stratoserver.net; posting-host="4f9e2254582c2e70fb7964ae27f7c514"; logging-data="6249"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+bHbi2oVenklCRx61ldJ8d" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:kIXSiqMR+iZ6DkT8ods+T/sLs7o= sha1:VCkZZMOTxn3ylFHt0UcmiotlY/4= Xref: reader02.eternal-september.org comp.lang.ada:51242 Date: 2018-03-28T12:06:21-07:00 List-Id: reinert writes: > I use gnat on debian (latest version). Now I tried to initiate a large > number of (access) tasks ( "t := new atask_type" ). When I try to > start, say, 500 tasks, my program slows down whithout any apparent > reason (before the tasks do anything). > Any hope for a quick fix? Gnat uses OS threads for tasks so they're not exactly lightweight, though 500 isn't an enormous number on modern hardware. If you're on a tiny embedded platform or VPS then it might be cramped, but if you have (say) 1GB of ram available then in the usual case where most of the tasks are blocked on i/o most of the time, you should be ok. If they're all cpu-busy then of course things will be slow.