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!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Performance of many concurrent delay() calls Date: Wed, 9 Nov 2016 16:15:13 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <1a375eea-b087-4080-a492-62bc26a8123c@googlegroups.com> <9e35ad48-8af5-4abc-aa67-70b9edd3ab24@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 9 Nov 2016 23:14:50 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="39e879381993545c8771646b3d75db6a"; logging-data="23447"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Jqi3gKoMIB5NqydtixoBdSDKwk2cECL0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 In-Reply-To: <9e35ad48-8af5-4abc-aa67-70b9edd3ab24@googlegroups.com> Cancel-Lock: sha1:8WBR83WuzdkcFonUV4KiZ4gKfWg= Xref: news.eternal-september.org comp.lang.ada:32273 Date: 2016-11-09T16:15:13-07:00 List-Id: On 11/09/2016 08:50 AM, Olivier Henley wrote: > > Right now I am doing the following inside the On_Connect handler > > loop > if Main_Window.Connection_Data = null then > exit; > end if; exit when Main_Window.Connection_Data = null; > App_Central.Process_Message (App_Data); > > delay 1.0; > end loop; > > Is it fine or the usage of a task is strongly recommended and for what reasons? I don't know. IIUC, Gnoga creates a task to call the on-connect handler, and you're keeping that task busy in the handler for the life of the connection. I don't know what the effect of that on the Gnoga internals might be. If it works OK for lots of connections, then it's probably OK. Botton would know for sure. Personally, I'd rather not tie up a task from a library without knowing more about what the consequences are. -- Jeff Carter "I've seen projects fail miserably for blindly applying the Agile catechism: we're Agile, we don't need to stop and think, we just go ahead and code!" Bertrand Meyer 150