1751975 Members
4652 Online
108784 Solutions
New Discussion юеВ

Thread question (11i v2)

 
SOLVED
Go to solution
Arunvijai.S
Frequent Advisor

Thread question (11i v2)

Hello All,

How to find at run time, whether a running application uses 1x1 or MxN thread model ?

Thanks,
Arun
8 REPLIES 8
Manish Srivastava
Trusted Contributor

Re: Thread question (11i v2)

Hi Arun,

The VERSION in the /usr/include/sys/pthreads.h can be used to differentiate between 1x1 or MxN model.

#ifdef PTHREAD_COMPAT_MODE
#define __PTHREAD_LIBRARY_VERSION_1 0x1
#else
#define __PTHREAD_LIBRARY_VERSION_1 0x2
#endif

COMAT mode is 1x1 model.

HTH

manish
Arunvijai.S
Frequent Advisor

Re: Thread question (11i v2)

Hello Manish,

Thanks for your answer. I want to find whether a running application uses 1x1 thread model or MxN threads on 11iV2. Am i clear with my question?

Thanks,
Arun
Manish Srivastava
Trusted Contributor

Re: Thread question (11i v2)

Hi Arun,

You can use gdb to attach to the process and then print the value of _TALL_1x1. If it is set to 1 then the application is using 1x1 model else it is using MxN model.

manish.
Arunvijai.S
Frequent Advisor

Re: Thread question (11i v2)

Hello Manish,

Yes, Using gdb would work. Are there any tools like elfdump, odump, nm available with HPUX to find this out ?

Thanks,
Arun
Manish Srivastava
Trusted Contributor

Re: Thread question (11i v2)

Hi Arun,

I am sorry I do not know about any such tool for this :-(.

manish.
Arunvijai.S
Frequent Advisor

Re: Thread question (11i v2)

Hello Manish,

I have compiled a test program with -DPTHREAD_COMPAT_MODE and tested it with gdb.
After pthread creation, i tried to find symbol _TALL_1x1 using print. It didnt turm out anything.

(gdb) s
[Switching to process 27708]
main () at test.c:17
17 pthread_exit(NULL);
(gdb) p _TALL_1x1
No symbol "_TALL_1x1" in current context.

How to get the symbol information ?

Thanks,
Arun
Manish Srivastava
Trusted Contributor
Solution

Re: Thread question (11i v2)

Hi Arun,

_TALL_1x1 is a newly added macro in the latest release. If you are running on earlier release you will not see this and it means that you are running 1x1 model.

There is another variable __MxN which is newly add which can be used to find out whether you are running 1x1 or MxN.

HTH
manish.

Arunvijai.S
Frequent Advisor

Re: Thread question (11i v2)

Hello Manish,

Which release you are refering to ? LR or IC ?

Thanks,
Arun