Hi!
According to http://0pointer.de/blog/projects/name-your-threads.html, it's possible to give names to pthreads.
This could be especially helpful in debugging sessions, either to find the corresponding RTPRIOs or even later to discover where things go wrong. gdb support for thread names is on its way.
glibc has recently added the corresponding pthread_setname_np and pthread_getname_np functions, however, this functionaly won't be available for endusers anytime soon, so we have to stick to prctl instead.
The attached patch names the FFADO threads. This is the output *without* the patch:
adi@hex:/root/ffado-trunk/libffado$ cat /proc/`pgrep jackd`/task/*/comm
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
jackd
And here now the result with the patch applied:
adi@hex:/root/ffado-trunk/libffado$ cat /proc/`pgrep jackd`/task/*/comm
jackd
jackd
jackd
jackd
WDGHBT
WDGCHK
BUSRST
ARMSTD
ARMRT
CTRHLP
ISOXMT
ISORCV
jackd
jackd
Looks useful, isn't it? ;)