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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e33eec6b5394f9ec,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-08-27 08:52:56 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: fjloma@andaluciajunta.es (Francisco Javier Loma Daza) Newsgroups: comp.lang.ada Subject: Multiple linked data structure Date: 27 Aug 2003 08:52:55 -0700 Organization: http://groups.google.com/ Message-ID: <404ee0af.0308270752.90ac2b6@posting.google.com> NNTP-Posting-Host: 62.36.122.245 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1061999576 27998 127.0.0.1 (27 Aug 2003 15:52:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 27 Aug 2003 15:52:56 GMT Xref: archiver1.google.com comp.lang.ada:41895 Date: 2003-08-27T15:52:56+00:00 List-Id: I am reading some OS sources (C sources), and I have seen a common structure, for example: a procces can be waiting on the processor wait queue, disk queue and network queue. This is implemented by several next pointer on the respective queue; add a new queue, then add a new pointer on the task structure, and potentially a new set of queue operations. In C this can be alleviated by preprocessor tricks, and I was wondering how to make this in Ada. The first option can be to have a generic queue instantiated with the task record type, but then some combined iteration can be more complicated. For example, iterating through the processor queue and quering if it has pending io requests by testing null for some (network, disk) next pointers. With the separate queue object, it would be needed to have some bits on the task structure to cache this information, or simply iterate the correspondings queues ...... Have you faced a similar question? are there a design pattern that encapsulates and solves efficiently this kind of problems? Thanks in advance