Skip to content

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 <[email protected]>
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 <[email protected]>
@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.

3 participants