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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Structure of the multitasking server Date: Fri, 13 Mar 2015 09:15:09 +0100 Organization: cbb software GmbH Message-ID: References: <8b4d1170-22e6-40d3-8ed1-096dc0163491@m36g2000hse.googlegroups.com> <71b51c8e-6bed-4156-9f52-31bef57b8575@googlegroups.com> <871tktuc9i.fsf@adaheads.sparre-andersen.dk> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: OpkKbm9QwHUq0Y4SxjI2mw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:25158 Date: 2015-03-13T09:15:09+01:00 List-Id: On Thu, 12 Mar 2015 15:39:02 -0700 (PDT), gautier_niouzes@hotmail.com wrote: > Le jeudi 12 mars 2015 22:38:50 UTC+1, Jacob Sparre Andersen a écrit : > >> This looks like a busy-wait to me. Is it? If not, why not? > > Seems so. Is it bad? Yes. > Well it may eat one core or CPU's performance. > Is it better with a small delay (see below) to cool down the boss ? You could add a wakeup event to prevent busy waiting. An alternative would be a waitable jobs queue. BTW, you seem have another problem. The drivers/workers are serviced always in the same order which would systematically choke ones near to the list end. A usual solution of this problem is list walking entered at the point where it was left. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de