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: border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!news.mixmin.net!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 21:47:50 +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: w2sqUGEBZqsVBYNL7Ky3Kg.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: number.nntp.giganews.com comp.lang.ada:192472 Date: 2015-03-13T21:47:50+01:00 List-Id: On Fri, 13 Mar 2015 13:16:29 -0700 (PDT), gautier_niouzes@hotmail.com wrote: > Le vendredi 13 mars 2015 09:14:52 UTC+1, Dmitry A. Kazakov a écrit : > >> You could add a wakeup event to prevent busy waiting. An alternative would >> be a waitable jobs queue. > > Wouldn't a delay instruction help ? It helps switching to another task before the scheduler preemts the task Process, which would normally happen after a timer interrupt. If Process is through *before* the time quant is expired, delay 0.0 cause Process giving up the core. [I don't understand what are you going to do] >> 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. > > Do you mean worker #1 would tend to be overworked compared to the others ? > In the program I run - perhaps because the jobs are long: a few seconds > number crunching - it doesn't seem to be the case: > > Worker 1 362 jobs > Worker 2 540 jobs > Worker 3 652 jobs > Worker 4 359 jobs > Worker 5 366 jobs > Worker 6 592 jobs > Worker 7 371 jobs > Worker 8 370 jobs The problem should first appear under 100% load. It would not appear if you never exit the loop. But it seems that you do. (Not that I really understand what are you going to achieve.) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de