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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.172.9 with SMTP id k9mr4230538ywh.52.1484915546428; Fri, 20 Jan 2017 04:32:26 -0800 (PST) X-Received: by 10.157.8.10 with SMTP id 10mr1434823oty.19.1484915546378; Fri, 20 Jan 2017 04:32:26 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!r185no844294ita.0!news-out.google.com!h135ni13582ith.0!nntp.google.com!r185no844290ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 20 Jan 2017 04:32:26 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=160.46.252.16; posting-account=mOyWBQoAAAD7S-NBmMUOr9hRClcL0vqR NNTP-Posting-Host: 160.46.252.16 References: <396469b6-6efe-49e7-914b-9226637e031e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7552bc76-fba8-4208-b855-e47140986488@googlegroups.com> Subject: Re: tasking design considerations From: rrr.eee.27@gmail.com Injection-Date: Fri, 20 Jan 2017 12:32:26 +0000 Content-Type: text/plain; charset=UTF-8 Xref: news.eternal-september.org comp.lang.ada:33103 Date: 2017-01-20T04:32:26-08:00 List-Id: On Friday, January 20, 2017 at 9:42:36 AM UTC+1, Dmitry A. Kazakov wrote: ... > Yes. Two minor notes: > > 1. It is not a stack (LIFO) it a FIFO, I suppose you want to keep the > messages ordering. OK, yes, it is a FIFO storage. > 2. You don't need a protected object or other locking method because a > FIFO with a single writer and a single reader is task-safe (can be > designed lock-free). > I don't understand. It might be that the task reading the FIFO starts while a callback is active adding a message to the FIFO. I think there must be a lock to exclude reading and writing the FIFO at the same time. RE