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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.198.12 with SMTP id w12mr23181782iof.105.1522268264401; Wed, 28 Mar 2018 13:17:44 -0700 (PDT) X-Received: by 2002:a9d:e5b:: with SMTP id n27-v6mr920519otd.2.1522268264304; Wed, 28 Mar 2018 13:17:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!u184-v6no6647002ita.0!news-out.google.com!u64-v6ni2382itb.0!nntp.google.com!u184-v6no6646999ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 28 Mar 2018 13:17:43 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.167.110.222; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 85.167.110.222 References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Large number of tasks slows down my program (using debian) - any fix? From: reinert Injection-Date: Wed, 28 Mar 2018 20:17:44 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:51245 Date: 2018-03-28T13:17:43-07:00 List-Id: Seems like "active components/objects" is not so simple as I hoped for. Sometimes it seems active objects facilitate "effective (natural) representation". But there seems to be restrictions :-) reinert On Wednesday, March 28, 2018 at 9:21:14 PM UTC+2, Dmitry A. Kazakov wrote: > On 2018-03-28 20:06, reinert wrote: > > > 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). > > 500 tasks is way too many. > > > Any hope for a quick fix? > > Unlikely. Re-design: use a pool of working tasks, queue jobs to them. > Use state machines instead of active objects. Switch from blocking I/O, > to asynchronous/overlapped I/O. Use select socket instead of blocking > sockets etc. > > P.S. co-routines/passive tasks is a way to migrate from the craziness > you have to a reasonable design without complete re-design. > > -- > Regards, > Dmitry A. Kazakov > http://www.dmitry-kazakov.de