[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#3950) sched_yield() considered harmful



bernie@develer.com wrote:
>  I don't quite understand why OpenLDAP ever needs to poll with
>  pthread_yield().  Instead of spinning on shared variables, locking
>  should be done using pthread's synchronization primitives, most of
>  which are implemented efficiently on Linux with futex().

>  If OpenLDAP must remain compatible with OSes where pthreads aren't
>  available, locking can be abstracted in portability functions like
>  sched_yield() was.

This is not an issue of OpenLDAP compatibility, or OSes which do or 
don't support pthreads. sched_yield()
is a standard feature of pthreads. It is neither optional nor 
"non-portable" and is used heavily in more software than just OpenLDAP. 
If the current Linux kernel hackers want to convince all the application 
developers out there to rewrite their software for the 2.6 kernel's 
benefit that's certainly their prerogative, but they should not be 
surprised if this decision is met with resistance.

-- 
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  OpenLDAP Core Team            http://www.openldap.org/project/