httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <>
Subject RE: [PATCH 2] worker MPM deadlock
Date Wed, 22 May 2002 17:50:44 GMT
On Wed, 22 May 2002, Ryan Bloom wrote:

> > You may be right but I would -hope- that a spec pthread implementation
> > would handle pthread_yield() correctly...
> The problem is that Single Unix doesn't even define pthread_yield, and
> neither does the pthreads spec if I am reading it right.  It looks like
> they both require sched_yield, which should do the same thing, however.
> All I am saying is that this isn't a panacea, a lot more research would
> be needed before pthread_ or sched_ yield could be considered portable.

Right.  pthread_yield seems to be a non-portable extension, if I'm reading
right.  From /usr/include/pthread.h on Linux:

#ifdef __USE_GNU
/* Yield the processor to another thread or process.
   This function is similar to the POSIX `sched_yield' function but
   might be differently implemented in the case of a m-on-n thread
   implementation.  */
extern int pthread_yield (void) __THROW;

But likewise, yield() is not portable and neither is sched_yield().  This
is why we need apr_thread_yield() to be implemented on Unix, as I
mentioned the last time this came up.  But it's not.

void apr_thread_yield()

Oh joy.


   Cliff Woolley
   Charlottesville, VA

View raw message