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

samples/philosophers: Make output atomic with picolibc #53575

Merged
merged 2 commits into from
Feb 24, 2023

Conversation

keith-packard
Copy link
Collaborator

Picolibc doesn't have any output buffering for printk, so the various
pieces of the status line would get interleaved between threads. Build the
whole line in memory using snprintk and then print it in a single printk
call.

This series also has a patch in the test configuration to match the
'HOLDING' status as well as place the EATING status in the right sequence.

Signed-off-by: Keith Packard [email protected]

@zephyrbot zephyrbot added area: Portability Standard compliant code, toolchain abstraction area: CMSIS API Layer CMSIS-RTOS API Layer labels Jan 7, 2023
@stephanosio stephanosio self-requested a review January 26, 2023 16:48
Picolibc doesn't have any output buffering for printk, so the various
pieces of the status line would get interleaved between threads. Build the
whole line in memory using snprintk and then print it in a single printk
call.

Signed-off-by: Keith Packard <[email protected]>
This demo prints out STARVING, HOLDING, EATING, DROPPED, THINKING. The
HOLDING state was missing and the EATING state was placed in the wrong
sequence.

Signed-off-by: Keith Packard <[email protected]>
@carlescufi carlescufi merged commit 18b79a0 into zephyrproject-rtos:main Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CMSIS API Layer CMSIS-RTOS API Layer area: Portability Standard compliant code, toolchain abstraction
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants