Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do pthreads implementations differ in error conditions?

0
Posted

Why do pthreads implementations differ in error conditions?

0

taylor@template.com wrote: > I’d like to understand why pthreads implementations from different > vendors define error conditions differently. For example, if > pthread_mutex_unlock is called for a mutex that is not owned by the > calling thread. > > Under Solaris 2.5: “If the calling thread is not the owner of the > lock, no error status is returned, and the behavior of the program > is undefined.” > > Under AIX 4.2: It returns the EPERM error code. > > The problem may be that the AIX 4.2 implementation is based on draft 7 > of the pthreads spec, not the standard, but I certainly prefer the AIX > approach. > > Another example: pthread_mutex_lock is called for a mutex that is > already owned by the calling thread. > > Under Solaris 2.5: “If the current owner of a mutex tries to relock > the mutex, it will result in deadlock.” (The process hangs.) > > Under AIX 4.2: It returns the EDEADLK error code. > > Once again, the AIX approach certainly seems preferable. > > Aren’t these issues cl

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123