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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6f24e26ea2e03c4 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!newsfeed.straub-nv.de!feeder.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Threadpool with priority version 1.1 ... Date: Thu, 25 Mar 2010 17:30:05 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <21e6697e-fd7c-4c5e-93dc-8d894449b5e6@f8g2000yqn.googlegroups.com> <4ba9e189$0$6886$9b4e6d93@newsspool2.arcor-online.net> <1id5xnuz0x892$.1odbic5ppiv07.dlg@40tude.net> <4baa27f2$0$6770$9b4e6d93@newsspool3.arcor-online.net> <7794a413-34e9-4340-abcc-a6568246fc38@h18g2000yqo.googlegroups.com> Injection-Date: Thu, 25 Mar 2010 17:30:05 +0000 (UTC) Injection-Info: feeder.eternal-september.org; logging-data="23063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+45gowesr0ihX3exMuXEMWK5STPza0caY=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:wJtq8z9uJtrVP2xpTuSvGo5hTbQ= Xref: g2news1.google.com comp.lang.ada:9771 Date: 2010-03-25T17:30:05+00:00 List-Id: Maciej Sobczak expounded in news:7794a413-34e9-4340-abcc-a6568246fc38 @h18g2000yqo.googlegroups.com: > On 24 Mar, 17:40, Warren wrote: > >> Another barrier I see to this is the high cost of >> starting a new thread and stack space allocation. > >> Somehow you gotta make thread startup and shutdown >> cheaper. > > Why? > > The problem of startup/shutdown cost and how many cores you have are > completely orthogonal. > I see no problem in starting N threads at the initialization time, use > them throughout the application lifetime and then shut down at the end > (or never)... I forgot to mention that the disadvantage of this approach is that you have to "pre-allocate" stack space for each thread (whether by default amount or by a specific designed amount). If you used a true cactus stack, this is not an issue. But with a traditional thread, you could choose stack requirements at the point of thread creation. Not so, if you create them all up front. So there are downsides to this approach. Warren