Skip to content

Add a sched_getcpu wrapper#1825

Merged
bors[bot] merged 1 commit intonix-rust:masterfrom
jonas-schievink:sched-getcpu
Sep 27, 2022
Merged

Add a sched_getcpu wrapper#1825
bors[bot] merged 1 commit intonix-rust:masterfrom
jonas-schievink:sched-getcpu

Conversation

@jonas-schievink
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/sched.rs Outdated
}

/// Determines the CPU on which the calling thread is running.
pub fn sched_getcpu() -> Result<usize> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It looks like this is supported on other platforms, including FreeBSD and DragonFly.

Can you move this to the sched_affinity section below (since it seems related and has these platforms already?

@rtzoeller
Copy link
Copy Markdown
Collaborator

Thanks! Can you modify the existing test here to validate that setting the affinity actually has an effect by calling sched_getcpu?

@jonas-schievink
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've addressed the comments.

@rtzoeller
Copy link
Copy Markdown
Collaborator

@jonas-schievink can you squash the current changes into a single commit? Otherwise this looks great.

@jonas-schievink
Copy link
Copy Markdown
Contributor Author

Okay, I've squashed the commits

Copy link
Copy Markdown
Collaborator

@rtzoeller rtzoeller left a comment

Choose a reason for hiding this comment

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

bors r+

@bors bors bot merged commit a40d49b into nix-rust:master Sep 27, 2022
@jonas-schievink jonas-schievink deleted the sched-getcpu branch September 27, 2022 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants