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!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Thu, 16 Oct 2014 19:07:31 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: dynamic vs static tasks allocation Date: Thu, 16 Oct 2014 20:07:35 -0400 Organization: IISS Elusive Unicorn Message-ID: References: X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.68.178.170 X-Trace: sv3-Ar3zgJ+ggzWABBD4UVG/hY8SysvxmUtyG71o/boBVoaz1ldjM0EQP7PqnVAoFa61mQsY/GHZbVh/aba!zuSqnzc/zJLTHnDhl22JVBg9pgyfT0jVECXT3CzJMEnNYBJ0ffr7KQp0s42o/cHMfm2mLfrKITrs!kGdB1srdBjeSuXfujj80qn2shz0x X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2294 Xref: news.eternal-september.org comp.lang.ada:22541 Date: 2014-10-16T20:07:35-04:00 List-Id: On Thu, 16 Oct 2014 10:25:50 -0700 (PDT), Stribor40 declaimed the following: >If you know ahead of time how many tasks will be needed is it better to create tasks dynamically with new operator or just statically? > >Which is way is recommended and why even bother allocating dynamically? Avionics stuff creates all processes (and memory structures) during initialization -- the only reason for dynamic task creation would be if the /number of specific tasks/ is determined from a startup configuration file -- otherwise they are essentially statically determined. But for something like a simulation -> simplistic example: say animal interaction -- creating a dynamic task each time an animal is "born" might be a scheme (though such are likely more easily run using a before/after array of the critters in a loop -- not to mention having to "teach" the new one about the rest of the pack). Knowing how many are needed (without a configuration file) seems, to me, to imply declaring a fixed array of them at compile time. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/