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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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: g2news2.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Threadpool with priority version 1.1 ... Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH 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> Date: Fri, 26 Mar 2010 09:19:54 +0100 Message-ID: <1rn39ttn5pon9$.11n683q5t6itu.dlg@40tude.net> NNTP-Posting-Date: 26 Mar 2010 09:20:14 CET NNTP-Posting-Host: 7787f7ff.newsspool2.arcor-online.net X-Trace: DXC=YR?A;G On Thu, 25 Mar 2010 17:30:05 +0000 (UTC), Warren wrote: > 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). BTW, if this approach worked for an application, it should also do for the OS, e.g. why not to start all threads for all not yet running processes upon booting? If that worked, the effective observed startup time of a thread would be 0, and thus there would be nothing to care about. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de