-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve resource management and internal consistency in ES #797
Comments
Note - This came up in discussion in #28 -- split into a separate ticket as it probably warrants a separate review of its own. |
@tngo67 - is this approach acceptable for your team? Mostly under the hood, but ends with a much more consistent implementation of ID's. |
Yes! I vote for moving away from using array indices for IDs, at least for this specific issue, for reasons jphickey stated. |
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Introduce wrapper/accessor functions to look up table entries by ID for ES & EVS subsystems. __Do not use AppID as a table index__. Note - This does not change existing external APIs and AppIDs are still zero-based uint32. This only changes the internal structures to remove use of ID as an array index, and to use a lookup function to locate the table entry from an ID. All entry access is then performed via the table entry pointer, rather than as an array index. This provides the groundwork for abstract IDs without actually changing anything fundamental about resource IDs.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Introduce wrapper/accessor functions to look up table entries by ID for ES & EVS subsystems. __Do not use AppID as a table index__. Note - This does not change existing external APIs and AppIDs are still zero-based uint32. This only changes the internal structures to remove use of ID as an array index, and to use a lookup function to locate the table entry from an ID. All entry access is then performed via the table entry pointer, rather than as an array index. This provides the groundwork for abstract IDs without actually changing anything fundamental about resource IDs.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Update the EVS subsystem to follow the ES pattern for internal table management. Do not use AppID directly as a table index. Instead, use a separate lookup routine to get a pointer to the entry, then access the entry via the pointer. Also introduce inline helper functions to get/set status of entry (free/not free), etc.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Minor fixup for use of IDs when logging
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Change SB to get its task ID from ES rather than getting it directly from OSAL. Update syslog calls to use the ES-supplied conversion to integer rather than direct cast.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Update TBL to use the new ES-supplied ID manipulations. Update all syslog calls to convert to integer using ES wrapper.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Sep 2, 2020
Update the TIME subsystem to use the new ES-supplied ID abstractions. Do not use AppID directly as array index when registering sync callbacks, use the ES-supplied conversion to array index before accessing local table. Also update logging to use ES-supplied conversion
astrogeco
added a commit
that referenced
this issue
Sep 4, 2020
Fix #797, refactor internal table/id management
This was referenced Sep 8, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Executive Services (ES) maintains many internal tables of resources/objects, which track applications, libraries, tasks, counters, and memory pools, etc.
There is a lot of inconsistency in how these internal objects are managed/tracked. Some have a
RecordUsed
boolean that is set true/false depending on whether the record is used. App table uses theAppState
member. The memory pool passes around direct pointers which are dereferenced (potentially dangerous).Furthermore, all "ID" values issued to external apps are zero based, and therefore can easily alias other object types or even other objects of the same type. For instance, if one app had ID "5" and it was deleted, and after this a new/different app was started, the new app might also be assigned ID "5" ... this means any old/stale reference to AppID 5 will now be referring to the wrong app.
Describe the solution you'd like
Define a properly abstract "resource ID" type and use it consistently across all these various internal tables. The abstraction should be based on/compatible with what OSAL does for its internal records.
memset()
to all zero can consistently clear an entry). Valid entries/ids are never zero.Additional context
This internal cleanup is a prerequisite to several related tickets:
Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: