Skip to content
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

Storage of (t,s,d) Triplets in OutRegistry #76

Closed
pasetti opened this issue Sep 22, 2017 · 2 comments
Closed

Storage of (t,s,d) Triplets in OutRegistry #76

pasetti opened this issue Sep 22, 2017 · 2 comments
Assignees

Comments

@pasetti
Copy link
Contributor

pasetti commented Sep 22, 2017

The OutRegistry keeps track of the enable status of each (type,subtype,discriminant) triplet. For this purpose, it needs a data structure where this information is stored. The data structure must be easily searchable.

The current implementation is wasteful of memory because it allocates to each (t,s) pair N bits where N is the maximum value of the discriminant for reports of type (t,s).

Marcel has proposed the following solution:

  • The user must define the maximum number of (t,s,d) triplets
  • The data structure consists of an ordered sequence of (t,s,d) triplets
  • The data structure is initialized with the (t,s,d) triplets which are statically known
  • If a new triplet is defined dynamically or an existing one is deleted, the list is dynamically adjusted (this requires at most M operations where M is the maximum number of (t,s,d) triplets
@pasetti pasetti self-assigned this Sep 22, 2017
@pasetti
Copy link
Contributor Author

pasetti commented Sep 27, 2017

In fact, the solution outlined above would not work: owing to the way the OutRegistry interface is defined, it is necessary for it to have a statically defined list of all possible triplets.

As an alternative, we could characterize each out-going report/command through four data: (t,s,d1,d2). Here (t,s) are the type and sub-type of the report/command and d1/d2 are one of the following:

  • They are both zero if the pair (t,s) has no discriminant
  • They are the minimum and maximum value of the discriminant if the set of legal discriminant values is specified through a range
  • They are equal and non-zero if the set of legal discriminant values are specified one by one (in that case there will be one entry for each discriminant value for a given (t,s) pair)

@pasetti
Copy link
Contributor Author

pasetti commented Oct 22, 2018

The following solution has been implemented. Each out-going report/command in the OutRegistry is characterized through four data: (t,s,d1,d2). Here (t,s) are the type and sub-type of the report/command and d1/d2 are one of the following:

  • They are both zero if the pair (t,s) has no discriminant
  • They are the minimum and maximum value of the discriminant

@pasetti pasetti closed this as completed Oct 22, 2018
pasetti added a commit that referenced this issue Oct 22, 2018
Each out-going report/command in the OutRegistry is characterized through four
data: (t,s,d1,d2). Here (t,s) are the type and sub-type of the report/command
and d1/d2 are one of the following:

- They are both zero if the pair (t,s) has no discriminant
- They are the minimum and maximum value of the discriminant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant