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

Use `thread-id` in thief_id call #347

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@hodgesds
Copy link

hodgesds commented May 24, 2017

Hi, I'm new and wanted to help out a little if I can. I might not have followed all the conversation in the related issue but happy to help out if I can.

Resolves: #335

@cuviper
Copy link
Member

cuviper left a comment

The change here looks good. My only hesitation is that we were talking on gitter about possibilities for an extended join that reports when jobs are stolen, which would make these ID comparisons unnecessary.

Well, plus we need to verify that there's no performance regression in this.

@@ -147,8 +148,7 @@ impl Splitter {
fn thief_id() -> usize {
// The actual `ID` value is irrelevant. We're just using its TLS
// address as a unique thread key, faster than a real thread-id call.
thread_local!{ static ID: bool = false }
ID.with(|id| id as *const bool as usize)
thread_id::get()

This comment has been minimized.

@cuviper

cuviper May 25, 2017

Member

The comment should be updated too, like:

// The actual `ID` value is irrelevant, as long as it's unique.

@hodgesds hodgesds force-pushed the hodgesds:thread-id branch from 0821df2 to 40a936f May 25, 2017

@hodgesds

This comment has been minimized.

Copy link
Author

hodgesds commented May 25, 2017

Thanks for the comments, I'll try to take a look at doing some performance testing tonight.

@nikomatsakis

This comment has been minimized.

Copy link
Member

nikomatsakis commented May 25, 2017

As it happens, I just made a wiki page about benchmarking that you may find useful. I can try to do some measurements too.

@nikomatsakis

This comment has been minimized.

Copy link
Member

nikomatsakis commented Sep 22, 2017

This is superceded by #354, right? I think I prefer that approach.

@nikomatsakis

This comment has been minimized.

Copy link
Member

nikomatsakis commented Sep 22, 2017

(To be clear, I appreciate the PR @hodgesds -- just seems better if we can avoid the dependency and make things a bit cleaner in the bargain. =)

Sorry for the long delay btw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.