Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for std::thread::ThreadId #21507
Comments
sfackler
added
the
A-libs
label
Jan 22, 2015
This comment has been minimized.
This comment has been minimized.
|
I'd also like to have |
This comment has been minimized.
This comment has been minimized.
|
I'd very much like some kind of thread id, I'm pretty sure every Thread implementation around gives numeric ids (Python has a string |
This was referenced Oct 29, 2015
This comment has been minimized.
This comment has been minimized.
|
FYI, here's the associated issue in the RFCs repo: rust-lang/rfcs#1435 |
alexcrichton
added
T-libs
B-unstable
labels
Oct 9, 2016
alexcrichton
changed the title
PartialEq not implemented for std::thread::Thread
Tracking issue for std::thread::ThreadId
Oct 9, 2016
bors
added a commit
that referenced
this issue
Oct 10, 2016
This comment has been minimized.
This comment has been minimized.
|
I think it would be fitting to implement |
steveklabnik
removed
the
A-libs
label
Mar 24, 2017
This comment has been minimized.
This comment has been minimized.
|
Just to chime in here, it would be really nice to have a proper |
This comment has been minimized.
This comment has been minimized.
|
There's a PR open to implement |
This comment has been minimized.
This comment has been minimized.
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 12, 2017
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 12, 2017
bors
added a commit
that referenced
this issue
Apr 12, 2017
bors
added a commit
that referenced
this issue
Apr 12, 2017
bors
added a commit
that referenced
this issue
Apr 12, 2017
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/libs, thoughts on stabilization? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
May 11, 2017
•
|
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
This comment has been minimized.
This comment has been minimized.
|
BTreeMap wants to know whether we could get an impl Ord for ThreadId. Are there any reasons not to have one? |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
I'd personally go either way on |
This comment has been minimized.
This comment has been minimized.
|
I'm not super concerned about the Ord impl. We certainly don't want to promise that IDs sort in order of creation - TIDs on Unix systems wrap around pretty frequently. |
This comment has been minimized.
This comment has been minimized.
|
FWIW, in the current implementation it's a monotonic u64 counter, with no relationship to the OS TID at all. So it will in fact sort in the order of creation, or the order when first seen for threads created outside of Rust. But I still wouldn't want to promise this. |
This comment has been minimized.
This comment has been minimized.
dlight
commented
May 16, 2017
|
If |
This comment has been minimized.
This comment has been minimized.
|
@dlight Currently, it already implements I don't see an issue with implementing The only issue I see is if we change the implementation later down the road to use system handles, it would be difficult to provide a stable |
This comment has been minimized.
This comment has been minimized.
|
We wouldn't be able to implement |
This comment has been minimized.
This comment has been minimized.
|
System handles also aren't globally unique when threads stop and new ones start. Is that a property we want to guarantee about |
This comment has been minimized.
This comment has been minimized.
That's a good point. I think that's why we chose not to use system handles in the first place: it makes @cuviper We don't currently make such a guarantee (which should reflect in the docs), but I think we should guarantee globally unique IDs. Assuming we don't plan on changing the IDs from being a custom integer. If the range of IDs becomes a problem, it is easy enough to increase the number of bits being used and maintain that guarantee. |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
May 23, 2017
|
|
rfcbot
added
the
final-comment-period
label
May 23, 2017
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Jun 2, 2017
|
The final comment period is now complete. |
aldanor commentedJan 22, 2015
•
edited by alexcrichton
Update description
Tracking issue for
std::thread::ThreadId. Points to consider when stabilizing:ThreadId, includingCopyOriginal report
Not sure if it can be considered as bug but it sure cripples the existing threading API (e.g., makes it harder for a thread to identify itself or store/pass its identity).
// it could also be nice if Thread was able to return a unique integer id() (or hash itself?..).