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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:4402:: with SMTP id r2mr298884ioa.30.1554146483157; Mon, 01 Apr 2019 12:21:23 -0700 (PDT) X-Received: by 2002:a9d:6941:: with SMTP id p1mr41069674oto.64.1554146483009; Mon, 01 Apr 2019 12:21:23 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!136no32267itk.0!news-out.google.com!r82ni32ita.0!nntp.google.com!78no32265itl.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Apr 2019 12:21:22 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=149.32.224.35; posting-account=Qh2kiQoAAADpCLlhT_KTYoGO8dU3n4I6 NNTP-Posting-Host: 149.32.224.35 References: <2d8df013-ed41-4b9f-8b26-b719cd2989b6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Competing Servers From: Anh Vo Injection-Date: Mon, 01 Apr 2019 19:21:23 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56033 Date: 2019-04-01T12:21:22-07:00 List-Id: On Tuesday, March 26, 2019 at 10:03:33 AM UTC-7, Dmitry A. Kazakov wrote: > On 2019-03-26 16:50, Anh Vo wrote: > > On Tuesday, March 26, 2019 at 6:11:12 AM UTC-7, Dmitry A. Kazakov wrote= : > >> On 2019-03-26 11:42, hnptz@yahoo.de wrote: > >> > >>> I want to consider any problem that can be viewed as search, and for = which only one solution is required, and the problem is suitable for a data= parallel approach, provided that the computation time is large enough to m= ake the communication time negligible. > >>> > >>> Assume we habe s servers and n tasks. I may start with one server and= n tasks. After a simple domain decomposition I want a task only search in = its allocated sub-domain. When one of the tasks has found a solution: it sh= ould report it, all tasks should stop immediately and the initiating progra= m should terminate. > >>> > >>> A variant from above would be to add a monitoring task, which after r= eceiving a success message by one of the tasks, should then report and stop= all tasks immediately and terminate. > >> > >> Usual design is a pool of worker task. A worker task takes jobs from a > >> queue controlled by a protected object. The task never terminates, jus= t > >> waits for another job. Cancellation of a job is done again over a > >> protected object. A worker task simply periodically checks if its > >> current job were terminated. The check will propagate an exception, th= at > >> will roll the stack with all local objects back to the main body loop > >> where the task will accept the next job. > >=20 > > why is an exception involved in the checking? >=20 > An easy method to roll back from a deep nested call. Considering that a= =20 > job solver will loop through many iterations, maybe doing recursive=20 > calls, then using a return value might be quite complicated. I am very curious about its complication. Thus, I would like to see an actu= al example if it is possible.