Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Lacking ability to name threads #1971

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

Comments

Projects
None yet
3 participants
Contributor

SoylentGraham commented Mar 26, 2013

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?)

Contributor

kylemcdonald commented Mar 26, 2013

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 :)

Contributor

SoylentGraham commented Mar 26, 2013

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.

Contributor

kylemcdonald commented Mar 26, 2013

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.

Contributor

SoylentGraham commented Mar 26, 2013

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 bakercp closed this May 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment