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!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Large number of tasks slows down my program (using debian) - any fix? Date: Thu, 29 Mar 2018 11:18:53 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1aa8f536-250d-4bef-9392-4d936f916e5f@googlegroups.com> <46be92cf-531f-483f-a98d-c96302110680@googlegroups.com> NNTP-Posting-Host: MyFhHs417jM9AgzRpXn7yg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:51251 Date: 2018-03-29T11:18:53+02:00 List-Id: On 29/03/2018 10:46, reinert wrote: > More from my investigations on trying to use many active objects (tasks): > > It seems for me that the "main processor" (running the main/top program/task) is used to guide/watch the entries ("accep") in the many tasks and making my program to run slow. > > Is it possible to make another processor to do this job? I am not sure what you mean. There is Ada's distributed annex and you could use remote procedure call from there. You could also use any other art of communication, e.g. some custom networking protocol. In any case that will require re-design and it would be likely much slower. I would suggest making objects passive, driven by an external task (from a pool of worker tasks). You will need a scheduler which to activate objects depending on the events and assigning free tasks to them. The objects will perform a small amount of actions and then return the control back keeping the state, e.g. awaiting for some event. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de