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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... Date: Thu, 30 Jul 2015 08:34:55 +0200 Organization: cbb software GmbH Message-ID: References: <9e492c82-868d-43d3-a18a-38274400e337@googlegroups.com> <40184feb-4053-4ac3-8eaa-c3bd9cd8a77c@googlegroups.com> <10272577-945f-4682-85bc-8ad47f3653ae@googlegroups.com> <87si8i81k2.fsf@atmarama.net> <8076cbd0-2655-4c98-b70e-cb5f0c32e4ba@googlegroups.com> <5e6cb30b-5f8c-4fed-969e-3941315ecba0@googlegroups.com> <87si87nf8k.fsf@jester.gateway.sonic.net> <877fpiom3q.fsf@jester.gateway.sonic.net> <87si86mehp.fsf@jester.gateway.sonic.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: ChlmA4XFxcJoDoqGdDSflw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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:194477 Date: 2015-07-30T08:34:55+02:00 List-Id: On Wed, 29 Jul 2015 21:54:58 -0700, Paul Rubin wrote: > Consider a multi-threaded program whose threads communicate through > async queues. So a work request comes into one thread, it gets decoded > into a dictionary (container instance), and then the dictionary is > dropped onto a queue. Another thread later picks it up and processes > it, sending the results through yet another queue. Since queues marshal data there is no place for GC here. You put a *copy* into the queue on one side and get another *copy* on the other. Queues, messages, mailboxes etc are all by-value. One of the advantages of Ada's tasking was the rendezvous allowing by-reference passing, since rendezvous is a synchronous call. Queueing references (I do it all the time implementing drivers and protocols) is a great pain and GC is no help, because of canceling requests and other sorts of stuff requiring deterministic time and order of execution such actions. GC (at least a built-in one) has no place in systems programming. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de