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,b59b337045eece60 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!newsfeed-fusi2.netcologne.de!news.netcologne.de!newsfeed-hp2.netcologne.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Structure of the multitasking server 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: <8b4d1170-22e6-40d3-8ed1-096dc0163491@m36g2000hse.googlegroups.com> <1w9y1ocmu2cm3$.724p6fohqdvy$.dlg@40tude.net> <259e95c5-92e6-4200-bc6e-5f35d99336a9@l64g2000hse.googlegroups.com> <11dyqk0lqb1je.ap31n7jjew7l.dlg@40tude.net> <1ey0wvc4tun7g$.15u4xyef05055$.dlg@40tude.net> <29fcd27f-aefd-4787-b8f6-5f8a04bd0f42@z72g2000hsb.googlegroups.com> <1njy6zbrm8yv0.fmtwebrb08bq$.dlg@40tude.net> <87ea7e07-1163-4fe5-8162-c5d46eed5bf7@m73g2000hsh.googlegroups.com> Date: Tue, 23 Sep 2008 11:37:41 +0200 Message-ID: <71jof7hlpcnh.1dsyhrbfw4av1$.dlg@40tude.net> NNTP-Posting-Date: 23 Sep 2008 11:37:41 CEST NNTP-Posting-Host: aa18fddc.newsspool1.arcor-online.net X-Trace: DXC=T=6N\o5Ji]M74okIm;?DS@ic==]BZ:afN4Fo<]lROoRA4nDHegD_]RENKV0UHj49PLDNcfSJ;bb[EFCTGGVUmh?DLK[5LiR>kgBDXK48JT:iWA X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2070 Date: 2008-09-23T11:37:41+02:00 List-Id: On Tue, 23 Sep 2008 01:07:38 -0700 (PDT), Maciej Sobczak wrote: > I don't like it, because it misuses exceptions for something that is a > perfectly normal control flow. I don't know how a control flow can be abnormal. If "normality" is attributed to the meaning of program's artefacts, then that is at the programmer's discretion. Is it normal not to have a job? For a worker that might look abnormal, for a welfare receiver it maybe not... > Yes, this is very subjective - for the record, I also don't like the > End_Error exception. But you certainly enjoy Constraint_Error... It is not subjective, it is unrealistic. > BTW - the fact that you raise an exception only to shut it up in the > same scope indicates that this is a severe misuse of some language > feature. I use this language feature in order to express "not a value" in a type-safe way. The same feature is used when an integer overflows. You didn't want "no job" become a job, so I used exceptions instead. (A return flag with a rubbish value is not an Ada way.) >>> In the version with protected objects the entity that triggers >>> termination might be different from the one that invents job. >>> In your version these different responsibilities are mixed. >> >> It does not work. You cannot selectively call to multiple entries of a >> protected object anyway. > > I don't have to. What I said is that the entities that provide jobs > and that trigger termination can be different, not that the worker can > get them from separate channels. If entries are different then the worker cannot selectively call to them. If they are never called by it, then how is this related to the worker? In your code there was only one entry called by the worker. >> Then again, termination should be triggered by >> task finalization > > Why? Which task? The worker task. >>> In particular, in my version the task that >>> invents jobs is never blocked on interactions with workers. This is a >>> big advantage, because such a blocking would disturb its own >>> interactions with the environment and reduce its responsiveness. >> >> This is a design fault. Under certain conditions it must either block or >> fail. > > Where is the design fault? The immediate failure (as opposed to > blocking) can be a valid overload handling policy. First you said that it neither blocks nor fail. Now you consider it to fail immediately. Fine, let's take this. Why then to queue jobs, which are known to fail later? (It is difficult to pursue a moving target...) >>> In your version with rendezvous the task that invents jobs has to >>> block and during that time it cannot react to the events that drive it >>> (keyboard input, network transmission, etc.). >> >> Wrong, see 9.7.1(16). > > Again: keyboard input, network transmission, etc. Select statement is > not flexible enough. 1. The selective accept statement is flexible enough. And in any case it is far more flexible than entry call statements. This is one of the reasons why rendezvous might be better in one to many relationships. The problem with the things you mentioned is that their interfaces are not conform to Ada tasking. There are many reasons for this, unrelated to the discussion. 2. Not all interfaces are like those. 3. In this particular case the server can block on job reception, because this is the only event to react to. >> Your design is when a multicasting >> publisher "knows" its peers. This is a bad idea, obviously. > > Why it is a bad idea? What is bad in the manager having knowledge > about workers in his team? Yes, obviously. This requires a team and maintenance of. Such managers are expensive and exposed to various risks. It might appear the only way of design when you deal with humans, but fortunately, with bits and bytes there are much better options. > Is your boss aware of you or do you need to constantly ask him for new > tasks? This is a model widely used when you don't want to employ staff permanently. If you have plenty of free workers, you just sit and wait them to come. Fee is paid per work made. See freelances, etc. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de