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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1d4203bfa2644439 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.74.74 with SMTP id r10mr3013980wiv.3.1355258357983; Tue, 11 Dec 2012 12:39:17 -0800 (PST) Path: i11ni118813wiw.0!nntp.google.com!proxad.net!feeder1-2.proxad.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Task with access to itself? Date: Tue, 11 Dec 2012 13:39:16 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <8738zk7gge.fsf@adaheads.sparre-andersen.dk> <87ehiwygv1.fsf@adaheads.sparre-andersen.dk> Mime-Version: 1.0 Injection-Date: Tue, 11 Dec 2012 20:39:17 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="21c3f140f3af3f178681f105ae93b5ae"; logging-data="9006"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Nma6h39akgmP+kvxQaWpXxlIabN2t+3E=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <87ehiwygv1.fsf@adaheads.sparre-andersen.dk> Cancel-Lock: sha1:HvsuW8wKJVaUPBZ/AsZUNIHhmz4= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-12-11T13:39:16-07:00 List-Id: On 12/11/2012 04:21 AM, Jacob Sparre Andersen wrote: > > This is a nice pattern, but it lacks two features I would like to have: > > 1) Dynamic addition of tasks. When we have a new job, if there are no tasks waiting on the queue of jobs, we allocate a new task. > 2) Control over which order the worker tasks are activated in. Why? They're all identical. In our case, we only allocate a task when there's a job to do and no existing task to handle it; such tasks are of course activated in the order they're created. -- Jeff Carter "C++ is like jamming a helicopter inside a Miata and expecting some sort of improvement." Drew Olbrich 51