Skip to content

core/cib: Add a prominent warning about thread safety #21401

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 1 commit into from
Apr 14, 2025

Conversation

maribu
Copy link
Member

@maribu maribu commented Apr 12, 2025

Contribution description

Users of CIB may easily be mislead to believing that it is generally thread safe, or at least thread safe as long as there is a single consumer and producer. Neither is the case, which now is clearly communicated in the API doc.

Testing procedure

The generated API should now make it clear that CIB is not thread safe. It should especially be clear that thread safety cannot even be assumed in special cases (such as single consumer, single producer, inherently atomic access to unsigned int), but requires the caller to ensure exclusive access to cib_t under any circumstances.

Issues/PRs references

See e.g. #21400 for an example where the calling side got their feet shot.

@maribu maribu requested a review from kaspar030 as a code owner April 12, 2025 08:21
@github-actions github-actions bot added the Area: core Area: RIOT kernel. Handle PRs marked with this with care! label Apr 12, 2025
@mguetschow mguetschow added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs Area: doc Area: Documentation labels Apr 14, 2025
Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this!

@github-actions github-actions bot removed the Area: doc Area: Documentation label Apr 14, 2025
Users of CIB may easily be mislead to believing that it is generally
thread safe, or at least thread safe as long as there is a single
consumer and producer. Neither is the case, which now is clearly
communicated in the API doc.

Co-authored-by: mguetschow <mikolai.guetschow@tu-dresden.de>
@maribu maribu force-pushed the core/cib/warn-about-thread-safety branch from 683dc98 to dcd3ee7 Compare April 14, 2025 12:30
@maribu maribu enabled auto-merge April 14, 2025 12:30
@riot-ci
Copy link

riot-ci commented Apr 14, 2025

Murdock results

✔️ PASSED

dcd3ee7 core/cib: Add a prominent warning about thread safety

Success Failures Total Runtime
1 0 1 01m:15s

Artifacts

@maribu maribu added this pull request to the merge queue Apr 14, 2025
Merged via the queue into RIOT-OS:master with commit d81844b Apr 14, 2025
25 checks passed
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 14, 2025
@maribu maribu deleted the core/cib/warn-about-thread-safety branch April 16, 2025 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: skip compile test If set, CI server will run only non-compile jobs, but no compile jobs or their dependent jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants