Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing pthread attributes

Status
Not open for further replies.

ycist

Programmer
Jul 3, 2002
1
US
I am working on rewriting a program on HP-UX. Orignally it use fork() and now it is using pthread. It turns out the performance of new code is much worse (about 30-50%). Since thread is supposed to be much light-weight than process, I believe it is the scheduling causes the new code slow. So, I tried to change the thread attribute so that it use PTHREAD_EXPLICIT_SCHED and
PTHREAD_SCOPE_SYSTEM. But then pthread_create() returns EPERM, which indicates that the parent thread does not have appropriate privilege.

Does HP-UX allows to change thread attributes? I appreciate your helps!
 
Are you running the code as a privileged user? EPERM means you don't have sufficient privileges to set a particular scheduling parameters/policy requested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top