Skip to content

Add thread yield capability #23

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

Merged
merged 2 commits into from
Jun 27, 2025
Merged

Add thread yield capability #23

merged 2 commits into from
Jun 27, 2025

Conversation

nandojve
Copy link
Contributor

Current the Behaviour Tree does not yield. This could lead to side effects like starvation and lost of interrupts on critical systems. This add the capability to the user define if engine should perform a k_yield() to give opportunity to other threads with the same priority to run.

This do not affect the time slice configuration and both can be used. The time slice can be useful when a very long action may block tree walk. To enable time slice make sure that behaviour tree priority is greater than TIMESLICE_PRIORITY and TIMESLICING=y.

The best walkthru performace can be achieve when
ZEPHYR_BEHAVIOUR_TREE_ALLOW_YIELD option is disabled.

@nandojve nandojve requested a review from otavio June 27, 2025 16:52
@nandojve nandojve self-assigned this Jun 27, 2025
nandojve added 2 commits June 27, 2025 19:53
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Current the Behaviour Tree does not yield. This could lead to side
effects like starvation and lost of interrupts on critical systems.
This add the capability to the user define if engine should perform
a k_yield() to give opportunity to other threads with the same
priority to run.

This do not affect the time slice configuration and both can be
used. The time slice can be useful when a very long action may
block tree walk. To enable time slice make sure that behaviour
tree priority is greater than TIMESLICE_PRIORITY and
TIMESLICING=y.

The best walkthru performace can be achieve when
ZEPHYR_BEHAVIOUR_TREE_ALLOW_YIELD option is disabled.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
@otavio otavio merged commit 80ba6cb into master Jun 27, 2025
1 of 2 checks passed
@otavio otavio deleted the add_yield branch June 27, 2025 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants