JagadeeshVN
MIS
Hi,
I have an application which runs on HP-UX11i ( 8 processor machine ). From my application, I am spawning 16/20 threads for doing a heavy processing job. Actualy I am threading a method of one of my classes like this:
int j = pthread_create( &threadId, NULL, CMyClass:
rocessThrFunc, (void*)pCMyComponent );
void* CMyClass:
rocessThrFunc( void* pParam )
{
CMyComponent* pCMyComponent = ( CMyComponent* )pParam;
pCMyComponent->StartProcessingFile( );
}
StartProcessingFile( ) method takes a file from input, and does some format conversions. After having done with the file, it simply waits, until another file name is passed to it.
while( m_bProcessHalt != SUN_TRUE )
{
while( m_bIdleStatus != SUN_TRUE )
{
sleep( 1 );
}
//Do the processing
}
This m_bIdleStatus is set from outside the class.
This works fine with thread count less than 8, and shows inconsistent behaviour when tried with 16/20( usually the program core dumps'. I am using aCC compiler and STL library, and I read from some of the articles that the STL library in HP-UX11i is not thread safe. Can I fix it that way ?
If that is the case, then how it works with 7 threads ?
Please help me by giving some tips / ( URLS to some articles ).
Thanks in advance
Jugs
I have an application which runs on HP-UX11i ( 8 processor machine ). From my application, I am spawning 16/20 threads for doing a heavy processing job. Actualy I am threading a method of one of my classes like this:
int j = pthread_create( &threadId, NULL, CMyClass:
void* CMyClass:
{
CMyComponent* pCMyComponent = ( CMyComponent* )pParam;
pCMyComponent->StartProcessingFile( );
}
StartProcessingFile( ) method takes a file from input, and does some format conversions. After having done with the file, it simply waits, until another file name is passed to it.
while( m_bProcessHalt != SUN_TRUE )
{
while( m_bIdleStatus != SUN_TRUE )
{
sleep( 1 );
}
//Do the processing
}
This m_bIdleStatus is set from outside the class.
This works fine with thread count less than 8, and shows inconsistent behaviour when tried with 16/20( usually the program core dumps'. I am using aCC compiler and STL library, and I read from some of the articles that the STL library in HP-UX11i is not thread safe. Can I fix it that way ?
If that is the case, then how it works with 7 threads ?
Please help me by giving some tips / ( URLS to some articles ).
Thanks in advance
Jugs