thread: add pthread-based threading module#72
Draft
arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
Draft
thread: add pthread-based threading module#72arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
pthread-based threading module#72arkjedrz wants to merge 1 commit intoeclipse-score:mainfrom
Conversation
Parametrizable threading module.
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
There was a problem hiding this comment.
Pull request overview
Adds a new thread Rust crate that provides a pthread-based, parameterizable thread-spawning API (scheduler policy/priority, CPU affinity, stack size) and integrates it into the workspace build (Cargo + Bazel).
Changes:
- Introduce
threadcrate withspawn+JoinHandle, plusThreadParameters/SchedulerParameters. - Implement
pthread_attr_*configuration for scheduling, affinity, and stack size. - Register the crate in the workspace (
Cargo.toml,Cargo.lock) and Bazel (src/thread/BUILD).
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/thread/thread.rs |
Core pthread-based implementation and unit tests. |
src/thread/parameters.rs |
Public parameter types for scheduler/affinity/stack size, plus tests. |
src/thread/lib.rs |
Crate module wiring and public re-exports. |
src/thread/Cargo.toml |
New crate manifest using workspace libc. |
src/thread/BUILD |
Bazel targets for the new Rust library and its tests. |
Cargo.toml |
Add src/thread to workspace members/default-members and deps. |
Cargo.lock |
Lockfile updates for new thread crate and libc. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+170
to
+172
| let data = unsafe { core::ptr::read(data as *const ThreadData<T, F>) }; | ||
| let result = (data.f)(); | ||
| Box::into_raw(Box::new(result)).cast() |
| data as *mut _, | ||
| ) | ||
| }; | ||
| if rc != 0 { |
Comment on lines
+195
to
+199
| /// An owned permission to join on a thread (block on its termination). | ||
| pub struct JoinHandle<T> { | ||
| thread: Thread, | ||
| _marker: PhantomData<T>, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Parametrizable threading module.
Notes for Reviewer
Pre-Review Checklist for the PR Author
Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #