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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b3258fa06e2efdf3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-02 16:52:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!sccrnsc02.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Tasks unleashed References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1051919529 12.234.13.56 (Fri, 02 May 2003 23:52:09 GMT) NNTP-Posting-Date: Fri, 02 May 2003 23:52:09 GMT Organization: AT&T Broadband Date: Fri, 02 May 2003 23:52:09 GMT Xref: archiver1.google.com comp.lang.ada:36894 Date: 2003-05-02T23:52:09+00:00 List-Id: > > Have you considered a protected Buffer of work to do and a fixed pool of > > tasks which queue on an entry waiting for the Buffer to have some work to > > ... > That's exactly what I'm doing :) but sometimes the "fixed" compromise > bugs me. ITOH, normally is better to have a upper bound for things, I > think. You could make a hybrid. An array of (initially null) pointers to tasks, and, if Buffers can't service a client in a reasonable length of time, you start up a "new" task. Then your fixed limit is buffer'length + task_array'length, but if the program actually only needs a few tasks, or is sufficiently patient, you will only start up a small number of tasks. Of course if your program desperately needs a large number of tasks early in execution, but not later, you'll have to depend on virtual memory to move those, now superfluous, tasks out of RAM. If the program really has phases like that, perhaps it should be split into two programs to be run sequentially.