3

I am using Qt 4.8 on Linux. I have the class ZoneManagerThread that inherits the class QThread. In the constructor of this class I am calling the following routine:

this->setObjectName("ZoneManagerThread");

However when I execute ps -eLf I don't see any thread named ZoneManagerThread.

What is the problem here? How can I solve this?

NG_
  • 6,895
  • 7
  • 45
  • 67
user3629119
  • 151
  • 1
  • 9

2 Answers2

3

In linux you have a maximum thread length - 16 bytes. Your thread name is 18.

See: change thread name on linux (htop)

Can you choose a smaller thread name and re-test ? (in my tests the thread name was truncated... but I worked directly with posix APIs... I am not sure what Qt4 does in this area).

Community
  • 1
  • 1
elcuco
  • 8,948
  • 9
  • 47
  • 69
0

Try again without setting the object name at all. The class name should be used for the thread name. If it doesn't, it means that your platform somehow doesn't support thread names, or that the class name is too long as well.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313