freebsd-dev/include
John Birrell b847980f15 o Runnable threads are now maintained in priority queues. The
implementation requires two things:

      1.) The priority queues must be protected during insertion
          and removal of threads.  Since the kernel scheduler
          must modify the priority queues, a spinlock for
          protection cannot be used.   The functions
          _thread_kern_sched_defer() and _thread_kern_sched_undefer()
          were added to {un}defer kernel scheduler activation.

      2.) A thread (active) priority change can be performed only
          when the thread is removed from the priority queue.  The
          implementation uses a threads active priority when
          inserting it into the queue.

    A by-product is that thread switches are much faster.  A
    separate queue is used for waiting and/or blocked threads,
    and it is searched at most 2 times in the kernel scheduler
    when there are active threads.  It should be possible to
    reduce this to once by combining polling of threads waiting
    on I/O with the loop that looks for timed out threads and
    the minimum timeout value.

  o Functions to defer kernel scheduler activation were added.  These
    are _thread_kern_sched_defer() and _thread_kern_sched_undefer()
    and may be called recursively.  These routines do not block the
    scheduling signal, but latch its occurrence.  The signal handler
    will not call the kernel scheduler when the running thread has
    deferred scheduling, but it will be called when running thread
    undefers scheduling.

  o Added support for _POSIX_THREAD_PRIORITY_SCHEDULING.  All the
    POSIX routines required by this should now be implemented.
    One note, SCHED_OTHER, SCHED_FIFO, and SCHED_RR are required
    to be defined by including pthread.h.  These defines are currently
    in sched.h.  I modified pthread.h to include sched.h but don't
    know if this is the proper thing to do.

  o Added support for priority protection and inheritence mutexes.
    This allows definition of _POSIX_THREAD_PRIO_PROTECT and
    _POSIX_THREAD_PRIO_INHERIT.

  o Added additional error checks required by POSIX for mutexes and
    condition variables.

  o Provided a wrapper for sigpending which is marked as a hidden
    syscall.

  o Added a non-portable function as a debugging aid to allow an
    application to monitor thread context switches.  An application
    can install a routine that gets called everytime a thread
    (explicitly created by the application) gets context switched.
    The routine gets passed the pthread IDs of the threads that are
    being switched in and out.  I found this useful, but we can
    get rid of it if you want.

Submitted by: Dan Eischen <eischen@vigrid.com>
1999-03-23 05:11:30 +00:00
..
arpa Update nameserver interface to bind-8.1.2 levels. We do not use IRS (yet?) 1998-06-11 08:55:17 +00:00
protocols 64bit clean now 1998-11-08 08:27:16 +00:00
rpc #ifdef out DES ioctls which don't exist in FreeBSD. These originated 1998-09-26 01:29:51 +00:00
rpcsvc Make rcsid a const char[] instead of char[] to avoid compiler warnings 1998-12-06 08:15:08 +00:00
_ctype.h Oops, fix typo in istype definition 1997-09-27 04:30:50 +00:00
a.out.h Woops, include machine/exec.h, too. 1994-09-24 21:49:20 +00:00
ar.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
assert.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
bitstring.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
ctype.h Oops, fix typo in istype definition 1997-09-27 04:30:50 +00:00
db.h Fix conflicts and merge into mainline (this may get cvs admined out and redone properly by Peter later) 1996-02-27 19:42:44 +00:00
dirent.h Merge Lite2 changes onto mainline: 1997-03-11 11:15:46 +00:00
disktab.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
dlfcn.h Replace bogus "@(#)err.h 8.1 (Berkeley) 6/2/93" with RCS Id keyword. 1998-02-11 05:19:10 +00:00
elf-hints.h Add hints file structures and defines. 1998-09-05 00:53:53 +00:00
elf.h Add hints file structures and defines. 1998-09-05 00:53:53 +00:00
err.h Don't forget to use the appropriate __printf*like attribute for verr* 1998-11-22 05:12:27 +00:00
fnmatch.h Removed _POSIX_SOURCE ifdefs. This is not a POSIX.1 header. 1998-02-25 02:15:59 +00:00
fstab.h Change to comment for fs_passno to reflect that it applies 1997-01-28 06:11:45 +00:00
fts.h Back out all of yesterdays include file changes. 1997-05-07 20:01:10 +00:00
glob.h Removed _POSIX_SOURCE ifdefs. This is not a POSIX.1 header. 1998-02-25 02:15:59 +00:00
grp.h Back out all of yesterdays include file changes. 1997-05-07 20:01:10 +00:00
histedit.h Update histedit.h to match the new libedit. 1997-06-25 09:47:31 +00:00
ieeefp.h Use __i386__ instead of i386 in an ifdef. 1999-03-05 18:15:05 +00:00
iso646.h Fixed garbage after comment after #endif. Fixed reversed sense of same 1998-08-03 10:59:02 +00:00
kvm.h Removed evil typedef kvm_swap_t and all uses of it (not many). 1999-01-27 11:29:15 +00:00
limits.h Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B and 1998-03-28 11:51:01 +00:00
link.h Add GDB support for ELF shared libs. 1998-05-23 15:17:53 +00:00
locale.h Basic support for LC_MESSAGES 1998-04-29 22:39:56 +00:00
Makefile Nuke old copies of /usr/include/timepps.h 1999-03-22 12:58:15 +00:00
malloc.h This file is deprecated not "obsoleted". 1997-04-13 11:33:17 +00:00
math.h Don't use __dead or __pure in user code. They were obfuscations 1996-09-14 03:00:32 +00:00
memory.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
mpool.h Back out all of yesterdays include file changes. 1997-05-07 20:01:10 +00:00
ndbm.h Don't reference ndbm(3) manpage. Everything is covered by db(3). 1996-03-03 09:04:40 +00:00
netdb.h Update nameserver interface to bind-8.1.2 levels. We do not use IRS (yet?) 1998-06-11 08:55:17 +00:00
nl_types.h Prototypes/typedefs cleanup 1998-04-30 10:09:58 +00:00
nlist.h Move nlist related defines from link.h into nlist.h. Clean up 1997-12-06 17:59:52 +00:00
objformat.h Add a new library function getobjformat(). It checks all the 1998-09-09 01:21:25 +00:00
paths.h Move nologin from /etc to /var/run. This means one less file that has 1999-01-11 09:07:42 +00:00
pthread_np.h o Runnable threads are now maintained in priority queues. The 1999-03-23 05:11:30 +00:00
pthread.h o Runnable threads are now maintained in priority queues. The 1999-03-23 05:11:30 +00:00
pwd.h Use the correct type for uid and gid in struct passwd. Document it. 1999-01-18 02:14:20 +00:00
ranlib.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
regex.h Back out all of yesterdays include file changes. 1997-05-07 20:01:10 +00:00
regexp.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
resolv.h Remove the extern decl of ``h_errno''. It's already 1998-09-07 19:54:08 +00:00
rune.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
runetype.h Fixed longstanding namespace convolution involving rune_t vs wchar_t. 1996-05-01 00:40:10 +00:00
setjmp.h Suggested by: bde 1998-01-20 09:09:24 +00:00
sgtty.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
signal.h Add the prototype for sigwait(). 1998-08-25 11:08:22 +00:00
stab.h Made them idempotent. 1994-08-21 04:03:58 +00:00
stddef.h Fixed longstanding namespace convolution involving rune_t vs wchar_t. 1996-05-01 00:40:10 +00:00
stdio.h Added functions fseeko() and ftello() (from susv2). 1999-02-08 21:32:38 +00:00
stdlib.h Little reorganization: 1998-12-19 00:02:34 +00:00
strhash.h Remove trailing whitespace. 1995-05-30 05:05:38 +00:00
string.h Add a prototype for strtok_r(). 1999-01-20 21:21:26 +00:00
stringlist.h Add stringlist functions from NetBSD. (required for the new ftp(1) 1997-06-25 08:04:52 +00:00
strings.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
struct.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
sysexits.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
tar.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
time.h Make ctime_r, asctime_r, gmtime_r, and localtime_r available in libc. 1999-01-04 20:45:20 +00:00
timers.h Revert $FreeBSD$ to $Id$ 1997-02-23 09:21:14 +00:00
ttyent.h MF22: prototype fix. 1998-07-16 00:10:14 +00:00
unistd.h optreset is a POSIX extension, make it visible in POSIX_SOURCE scope. 1999-01-11 11:32:35 +00:00
utime.h Back out all of yesterdays include file changes. 1997-05-07 20:01:10 +00:00
utmp.h ut_time is a time_t, not a long. 1998-05-10 21:13:30 +00:00
vis.h Revert $FreeBSD$ to $Id$ 1997-02-23 09:21:14 +00:00