Skip to content

Print task ID in log messages#166

Merged
arthurp merged 2 commits intomainfrom
arthurp/thread-id-logging
Feb 24, 2026
Merged

Print task ID in log messages#166
arthurp merged 2 commits intomainfrom
arthurp/thread-id-logging

Conversation

@arthurp
Copy link
Copy Markdown
Contributor

@arthurp arthurp commented Feb 17, 2026

This adds the thread ID to all log messages.

I am open to the idea that this is not a good idea and this should not be merged. But I think it's probably generally useful, especially as the number of threads and messages increases.

@arthurp arthurp requested a review from aneeshdurg February 17, 2026 21:15
@arthurp arthurp marked this pull request as ready for review February 17, 2026 21:15
@arthurp arthurp requested a review from a team as a code owner February 17, 2026 21:15
@arthurp arthurp requested a review from ioeddk February 24, 2026 17:23
Copy link
Copy Markdown
Contributor

@ioeddk ioeddk left a comment

Choose a reason for hiding this comment

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

Who will ever set this id or initialize an id for a struct? Is it automatically controlled by Rust or Asterina's scheduler? If it's Asterinas, then are you sure the tid functionality is actually implemented and correct?

@arthurp
Copy link
Copy Markdown
Contributor Author

arthurp commented Feb 24, 2026

Task::id is assigned at

id: NonZeroUsize::new(NEXT_TASK_ID.fetch_add(1, Ordering::Relaxed)).unwrap(),

So it's already well defined.

@arthurp arthurp requested a review from ioeddk February 24, 2026 21:25
@arthurp arthurp merged commit b2883df into main Feb 24, 2026
19 checks passed
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