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

Revamp task creation so that there isn't a predefined maximum number of tasks #8

Open
dgobalak opened this issue Nov 4, 2022 · 1 comment

Comments

@dgobalak
Copy link
Owner

dgobalak commented Nov 4, 2022

Possible Options

  • Users can declare the required variables (thread struct) and pass in a pointer to that struct
  • Dynamically allocate memory for the thread struct
  • Both of the above options, similar to FreeRTOS. They'd both store pointers to the thread structs in an array anyways
@dgobalak
Copy link
Owner Author

dgobalak commented Nov 20, 2022

I think the way FreeRTOS does it is with a static array where the number of elements equals the number of possible priorities. Then, each element in the array points to a linked list.

We could use a statically allocated linked list where the user statically allocates the memory, but we store the previous and next thread in each osthread_t struct. We need to determine how this would impact our current algorithms and their time complexity.

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