comp.lang.ada
 help / color / mirror / Atom feed
* Multiple linked data structure
@ 2003-08-27 15:52 Francisco Javier Loma Daza
  2003-08-28  1:31 ` Matthew Heaney
  2003-08-28  9:03 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 3+ messages in thread
From: Francisco Javier Loma Daza @ 2003-08-27 15:52 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-08-28  9:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-27 15:52 Multiple linked data structure Francisco Javier Loma Daza
2003-08-28  1:31 ` Matthew Heaney
2003-08-28  9:03 ` Dmitry A. Kazakov

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