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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.xdsl-89-0-114-118.netcologne.de!not-for-mail From: Frank Buss Newsgroups: comp.lang.ada Subject: FIFO Date: Sat, 16 Sep 2017 17:24:18 +0200 Organization: news.netcologne.de Distribution: world Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 16 Sep 2017 15:24:18 +0000 (UTC) Injection-Info: newsreader4.netcologne.de; posting-host="xdsl-89-0-114-118.netcologne.de:89.0.114.118"; logging-data="11853"; mail-complaints-to="abuse@netcologne.de" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 X-Mozilla-News-Host: news://news.netcologne.de:119 Xref: news.eternal-september.org comp.lang.ada:48148 Date: 2017-09-16T17:24:18+02:00 List-Id: I need a FIFO with a fixed size, for buffering serial data on an embedded system. The FIFO will be filled in an interrupt and read from the main function. I guess I could implement this myself, using a simple array of e.g. 256 bytes, and then a read index and a write index. If I specify it with "pragma Volatile", nothing bad should happen. But I read about bounded vectors. Could I use this as well and save a few lines of code and testing work? I'm a bit worried about if the behavior is standardized, such that e.g. Delete_First doesn't physically move all elements, because this would be bad when writing it at the same time from the interrupt. Because it is bounded, it could be implemented as the simple ringbuffer as I would implement it. -- Frank Buss, http://www.frank-buss.de electronics and more: http://www.youtube.com/user/frankbuss