comp.lang.ada
 help / color / mirror / Atom feed
From: fjloma@andaluciajunta.es (Francisco Javier Loma Daza)
Subject: Multiple linked data structure
Date: 27 Aug 2003 08:52:55 -0700
Date: 2003-08-27T15:52:56+00:00	[thread overview]
Message-ID: <404ee0af.0308270752.90ac2b6@posting.google.com> (raw)

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



             reply	other threads:[~2003-08-27 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-27 15:52 Francisco Javier Loma Daza [this message]
2003-08-28  1:31 ` Multiple linked data structure Matthew Heaney
2003-08-28  9:03 ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox