Re: sched_yield() - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: sched_yield()
Date
Msg-id 199803220401.XAA02645@candle.pha.pa.us
Whole thread Raw
In response to Re: sched_yield()  (Mattias Kregert <matti@algonet.se>)
List pgsql-hackers
> Perhaps we should enable sched_yield() for every OS except for... well,
> what's the
> name of that OS which does not have sched_yield()...  FreeBSD ;)
>
> After all, sched_yield() is five years old. Any reasonable OS should
> have it.

Gee, I just checked and BSDI has it.  However, it appears to work only
on threaded applications:

     #include <pthread.h>
...
     If other threads are ready to run, the sched_yield() function forces the
     current thread to suspend itself temporarily and let them execute.



--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Re: sched_yield()
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: sched_yield()