From: Warren <ve3wwg@gmail.com>
Subject: Re: Generic Embedded List Nodes
Date: Thu, 23 Jun 2016 18:55:25 -0700 (PDT)
Date: 2016-06-23T18:55:25-07:00 [thread overview]
Message-ID: <687234fb-a16b-4310-8523-5c247a0359d3@googlegroups.com> (raw)
In-Reply-To: <dt2dvnFdi0mU1@mid.individual.net>
On Thursday, 23 June 2016 11:36:25 UTC-4, Niklas Holsti wrote:
> On 16-06-23 15:37 , Warren wrote:
> > On Thursday, 23 June 2016 04:19:35 UTC-4, Niklas Holsti wrote:
> >> On 16-06-23 05:12 , Warren wrote:
> >>> On Tuesday, 21 June 2016 17:38:36 UTC-4, Niklas Holsti wrote:
> >>> ...
> >>>> type Emb_Node_T is tagged;
> >>>>
> >>>> type Emb_Node_Ref_T is access all Emb_Node_T'Class;
> >>>>
> >>>> type Emb_Node_T is tagged record
> >>>> Prev, Next : Emb_Node_Ref_T;
> >>>> -- Prev and Next are null if the node is not in any list.
> >>>> -- When the node is first in a list, Prev points to the list head.
> >>>> -- When the node is last in a list, Next is null.
> >>>> end record;
> >>>>
> >>>> subtype List_T is Emb_Node_T;
> >>>> -- A list head.
> >>>> -- Next points to the first node in the list.
> >>>> -- Prev is null.
> >>> ...
> >>>
> >>> The insertion, traversal and deletes are generally no problem. The problem
> >>> occurs when traversing to access the object.
> >>
> >> Indeed I left out an example of traversal, sorry.
> >
> > No problem. The other issue is that I need to support at least
> > two lists. It gets rather messy when extending the object for
> > each additional list, IMO.
>
> My example had two embedded list nodes in the object, so the object
> could be a member of two lists. You can define as many nodes as you
> like, in the same record type, at the same time.
Ok, I see now (my eyes get bad by end of day after staring at screens all day).
I've been thinking today that by using the file descriptor as an index into a large array (of access to records), I can make this relatively clean in Ada. The array would not only act as a lookup for the event structures, but serve as a cache of such. I never really need to release them.
If I did want to reclaim any, I could start at the high end of the array, since those will be used under heaviest use. This is one of the nice features of the Unix kernel- open files always have the lowest available unit numbers assigned.
Warren
next prev parent reply other threads:[~2016-06-24 1:55 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 22:52 Generic Embedded List Nodes Warren
2016-06-18 23:40 ` Jeffrey R. Carter
2016-06-19 2:15 ` Warren
2016-06-19 3:04 ` Jeffrey R. Carter
2016-06-19 2:14 ` Jeremiah
2016-06-19 2:21 ` Warren
2016-06-19 2:50 ` Warren
2016-06-19 4:45 ` Simon Wright
2016-06-19 18:27 ` Warren
2016-06-19 19:04 ` Dmitry A. Kazakov
2016-06-19 20:13 ` Warren
2016-06-19 20:35 ` Dmitry A. Kazakov
2016-06-20 2:42 ` Warren
2016-06-20 7:25 ` Dmitry A. Kazakov
2016-06-20 12:26 ` Warren
2016-06-20 19:33 ` Niklas Holsti
2016-06-21 2:20 ` Warren
2016-06-21 5:52 ` Niklas Holsti
2016-06-21 7:15 ` Dmitry A. Kazakov
2016-06-21 18:54 ` Niklas Holsti
2016-06-21 19:54 ` Dmitry A. Kazakov
2016-06-21 10:31 ` Warren
2016-06-21 17:13 ` Jeffrey R. Carter
2016-06-21 18:56 ` Niklas Holsti
2016-06-21 20:13 ` Warren
2016-06-21 21:38 ` Niklas Holsti
2016-06-23 2:12 ` Warren
2016-06-23 8:19 ` Niklas Holsti
2016-06-23 12:37 ` Warren
2016-06-23 15:36 ` Niklas Holsti
2016-06-24 1:55 ` Warren [this message]
2016-06-24 12:49 ` Warren
2016-06-25 5:50 ` Niklas Holsti
2016-06-26 1:36 ` Warren
2016-07-01 13:49 ` Warren
2016-07-01 16:28 ` Warren
2016-06-24 20:25 ` Warren
2016-06-22 13:01 ` G.B.
2016-06-23 2:30 ` Warren
2016-06-20 6:08 ` Niklas Holsti
2016-06-20 12:20 ` Warren
2016-06-20 19:47 ` Shark8
2016-06-21 2:28 ` Warren
2016-06-21 7:21 ` Dmitry A. Kazakov
2016-06-21 10:32 ` Warren
2016-06-21 11:56 ` Dmitry A. Kazakov
2016-06-21 13:39 ` Warren
2016-06-21 14:04 ` Dmitry A. Kazakov
2016-06-23 0:37 ` Randy Brukardt
2016-06-23 2:25 ` Warren
2016-07-01 19:50 ` brbarkstrom
2016-07-02 1:55 ` Warren
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox