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

[core] Unique names for threads of Smack Cached Executor service #600

Closed

Conversation

guusdk
Copy link
Member

@guusdk guusdk commented Jun 14, 2024

Having unique names for threads of Smack's own executor service can help with debugging issues.

Having unique names for threads of Smack's own executor service can help with debugging issues.
@Flowdalic
Copy link
Member

I am a bit hesitant to add an atomic counter to thread creating. But maybe I am missing the motivation.

Looking at thread dumps, one sees

"Smack Cached Executor" #19
"Smack Cached Executor" #22 
"Smack Cached Executor" #26 

so yes, the thread names are not unique, but every thread has a unique ID. I never felt the need to make the thread names unique in such cases, so I am wondering about the motivation for doing so.

@guusdk
Copy link
Member Author

guusdk commented Jun 27, 2024

Some debuggers do not show the thread ID, just the name. I forgot which one, but I ran into that, causing me to create this PR.

I think there's precedent in Smack for numbering threads in this way (on mobile now, hard to check). I checked - it doesn't.

What is your concern with atomics? Aren't they benign? Alternatively, we could concatenate the thread name with getId() I guess. Or we just drop this PR completely - I'm far from deeply invested in this one.

@Flowdalic
Copy link
Member

Thanks for elaborating on it. I'd like to keep it as is. At least for now.

@Flowdalic Flowdalic closed this Sep 12, 2024
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