[osol-discuss] How to check the processor_id of the running threads inside an application?

2010-10-26 Thread dengning
Hi gurus, I wrote a multithread application by pthread and bind the threads with specific cpu cores by processor_bind(), now I am wanting to confirm if the binding is effective. I wonder if there is a system call to return the current core_id of a certain thread? I failed to get the answer by

Re: [osol-discuss] How to check the processor_id of the running threads inside an application?

2010-10-26 Thread Jason
Look at the PBIND_QUERY flag in processor_bind(2). The manpage suggests (though it's not as clear as it could be IMO) that it will return the current binding into the processorid_t structure pointed to by the 4th parameter. On Tue, Oct 26, 2010 at 8:43 AM, dengning dunning2...@gmail.com wrote:

Re: [osol-discuss] How to check the processor_id of the running threads inside an application?

2010-10-26 Thread Ignacio Marambio Catán
have you checked ps(1) ? On Tue, Oct 26, 2010 at 10:43 AM, dengning dunning2...@gmail.com wrote: Hi gurus, I wrote a multithread application by pthread and bind the threads with specific cpu cores by processor_bind(), now I am wanting to confirm if the binding is effective. I wonder if

Re: [osol-discuss] How to check the processor_id of the running threads inside an application?

2010-10-26 Thread dengning
Do you mean that if the third parameter is PBIND_QUERY while the last parameter is not NULL (obind here), the binding processorid structure will be stored in the last processorid_t obind? Then, I could read it... -- This message posted from opensolaris.org

Re: [osol-discuss] How to check the processor_id of the running threads inside an application?

2010-10-26 Thread Jason
That is what the manpage suggests. Looking at the source, it looks like that's what it does as well. On Tue, Oct 26, 2010 at 9:33 PM, dengning dunning2...@gmail.com wrote: Do you mean that if the third parameter is PBIND_QUERY while the last parameter is not NULL (obind here), the binding