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

[Feature Request] Dynamic Prioritization #1134

Closed
svenbieg opened this issue Sep 1, 2024 · 7 comments
Closed

[Feature Request] Dynamic Prioritization #1134

svenbieg opened this issue Sep 1, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@svenbieg
Copy link

svenbieg commented Sep 1, 2024

The problem is to define the priority on a task-level. Every task can call a critical function, so the priority has to be raised there.

My solution is a task-lock that works with a mutex. The task is marked exclusive, so interrupts are kept disabled after the task-switch until the task-lock is released.

You can take a look at the heap for example. It is used by every task and is a critical function. I'm using a task-lock there.

Best regards,

Sven Bieg

@svenbieg svenbieg added the enhancement New feature or request label Sep 1, 2024
@aggarg
Copy link
Member

aggarg commented Sep 3, 2024

Please create a post in the FreeRTOS Forums explaining your feature request in more detail, possibly with sequence diagrams to help us understand your request.

@svenbieg
Copy link
Author

svenbieg commented Sep 3, 2024

This time i'm sorry. You can find the detais here:

https://github.com/svenbieg/Scheduler

I'm happy to see You again, looking forward to my Christmas holidays. My kernel took me two weeks, it's really easy with know-how.
Your vTaskSuspendAll is too expensive, You need a mutex there that can be locked up to high priority.

Good luck, to the whole FreeRTOS-team!

I'm really sorry i don't have time at the moment,

Sven Bieg

@aggarg
Copy link
Member

aggarg commented Sep 3, 2024

Thank you for sharing your implementation. I assume you do not need anything from FreeRTOS for your implementation as your implementation does not depend on FreeRTOS.

@n9wxu n9wxu closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@svenbieg
Copy link
Author

svenbieg commented Sep 4, 2024

Semaphore sounds like a german joke.
"Seh'ma vor" is bavarian dialect for "we foresee". Mutex meaning is obvious, mutual exclusive.

@svenbieg
Copy link
Author

svenbieg commented Sep 10, 2024

You are right, exclusive mutual exclusion may sound funny at first, but it is exactly what You are missing.
If we have 100 tasks, access the heap, a high priority task is waiting, and the system timer interrupts, the high priority task has to wait for 100 task-switches.
What about mutex_lock, mutex_lock_shared and mutex_lock_up?

@svenbieg
Copy link
Author

svenbieg commented Sep 10, 2024

FIFO-task-management

@svenbieg
Copy link
Author

svenbieg commented Feb 2, 2025

Okay, i keep interrupts enabled and only block the scheduler when You call Mutex::Lock(TaskPriority::High).

https://github.com/svenbieg/Scheduler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants