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

Lacking ability to name threads #1971

Closed
SoylentGraham opened this issue Mar 26, 2013 · 5 comments
Closed

Lacking ability to name threads #1971

SoylentGraham opened this issue Mar 26, 2013 · 5 comments

Comments

@SoylentGraham
Copy link
Contributor

There is no interface to set the name of a Poco thread. Furthermore, setting the thread name in Poco::Thread doesn't set the OS thread name in windows (which is very handy for debugging)

I've implemented this in a branch, (as well as naming from ofThread constructor) but my git branches are a complete mess so I can't make a pull request right now
https://github.com/SoylentGraham/openFrameworks/commits/develop-ofThread_SetName

I have deadlines to meet at the moment but as soon as I've paid the bills I'll sort out my branches and make a PR. In the mean time, if anyone is looking for this feature, here it is... (Is this kind of post more appropriate for the forums?)

@kylemcdonald
Copy link
Contributor

this is cool! i didn't know this was possible, it definitely helps for debugging. could you submit it as a PR?

usually it's best for PRs to be posted as issues first, so we can agree that a potential solution is best... but since you've already written the code you might as well submit it as a PR and see what people think :)

@SoylentGraham
Copy link
Contributor Author

The inline win32 code is a bit messy, (more so if other platform code gets added) is there a more of-standard way of implementing platform specific versions of functions, rather than giant ifdef blocks? (Platform namespaces, func prefixes or something? Maybe I should finally read the guidelines :)

Will do a pull request as soon as I work out how to make a clean develop forked branch :/

  • graham
    http:///www.grahamreeves.com/

On 26 Mar 2013, at 01:37 AM, Kyle McDonald notifications@github.com wrote:

this is cool! i didn't know this was possible, it definitely helps for debugging. could you submit it as a PR?

usually it's best for PRs to be posted as issues first, so we can agree that a potential solution is best... but since you've already written the code you might as well submit it as a PR and see what people think :)


Reply to this email directly or view it on GitHub.

@kylemcdonald
Copy link
Contributor

if you branched from develop to create develop-ofThread_SetName it's probably 'clean'.

and if you check out the rest of OF, you'll find ifdef blocks where there are platform-specific implementations -- so while using the precompiler always feels like a bit of a hack, in this case (OS-specific code) i think it's the right solution.

@SoylentGraham
Copy link
Contributor Author

I did, but my develop already has other local changes, (which show up in the PR) so I don't have a non-modified branch in my fork.

I think I need to rebase, or force a reset.. but after an hour of fiddling around I gave up and went back to coding :) (getting off topic now, I'll figure it out when I have time)

  • graham
    http:///www.grahamreeves.com/

On 26 Mar 2013, at 01:51 AM, Kyle McDonald notifications@github.com wrote:

if you branched from develop to create develop-ofThread_SetName it's probably 'clean'.

and if you check out the rest of OF, you'll find ifdef blocks where there are platform-specific implementations -- so while using the precompiler always feels like a bit of a hack, in this case (OS-specific code) i think it's the right solution.


Reply to this email directly or view it on GitHub.

@bakercp
Copy link
Member

bakercp commented May 23, 2017

Closing this PR as ofThread now supports thread names

https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/utils/ofThread.cpp#L34

@bakercp bakercp closed this as completed May 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants