freebsd-skq/lib
John Birrell 58a7cc5d1b [ The author's description... ]
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.

Submitted by: Dan Eischen <eischen@vigrid.com>

Changes by me:

  o Added a PS_SPINBLOCK state to deal with the priority inversion
    problem most often (I think) seen by threads calling malloc/free/realloc.

  o Dispatch signals to the running thread directly rather than at a
    context switch to avoid the situation where the switch never occurs.
1999-03-23 05:07:56 +00:00
..
compat /usr/lib/compat -> /usr/lib/compat/aout 1998-09-26 11:54:02 +00:00
csu Add "-fkeep-inline-functions" to CFLAGS so that higher optimization 1999-03-15 21:56:54 +00:00
libalias Remove all diagnostics to stdout/stderr with #ifdef DEBUG 1999-03-09 23:44:00 +00:00
libatm libatm uses libmd; add it to the dependency list so that programs using 1998-10-11 04:41:43 +00:00
libbind Sigh, mkdep doesn't know about all the CFLAGS to pass during depend 1998-06-11 10:39:32 +00:00
libc Typo fix. 1999-03-23 05:01:11 +00:00
libc_r [ The author's description... ] 1999-03-23 05:07:56 +00:00
libcalendar .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq 1998-03-19 07:34:22 +00:00
libcam Fixed missing header in synopsis (<camlib.h> includes half the universe 1999-03-05 17:11:37 +00:00
libcom_err Remove definition of malloc and realloc. Instead include stdlib.h. 1998-09-11 05:39:08 +00:00
libcompat Correct typo. 1999-01-27 04:35:02 +00:00
libcrypt Simplified using new SYMLINKS macro, mainly to test this macro. The 1999-03-23 03:41:09 +00:00
libcurses Fix a curses bug exposed by the ":numbers" display of systat -iostat. 1998-10-12 16:32:32 +00:00
libdevstat Address our users in a civilized manner. (They may know better, but probably 1999-03-22 10:38:07 +00:00
libdisk More support for Alpha installs. 1999-01-29 11:39:24 +00:00
libedit Switch to using ".So" as the extension for PIC object files rather 1999-01-09 21:51:00 +00:00
libf2c Add an emply MAIN__() function. This avoid an unresolved reference error 1998-11-16 23:51:14 +00:00
libF77 Update to the most recent version. Among other things, this also solves 1999-02-03 17:23:49 +00:00
libfetch Fixed prototype for fetchParseURL(). 1999-03-05 18:45:32 +00:00
libftpio Correctly figure out that the remove cannot do passive mode. 1998-04-11 07:28:53 +00:00
libgnumalloc Don't install an elf libgnumalloc.so* in /usr/lib/compat.. No elf binaries 1998-10-11 04:18:30 +00:00
libI77 Update to the most recent version. Among other things, this also solves 1999-02-03 17:23:49 +00:00
libio Add a simple library for accessing i/o ports and memory on the alpha. 1998-12-12 18:05:06 +00:00
libipx Fixed printf format errors. 1998-06-30 18:06:23 +00:00
libkse [ The author's description... ] 1999-03-23 05:07:56 +00:00
libkvm make libkvm capable of dealing with a crashdump on alphas 1999-03-12 14:47:33 +00:00
libm Eliminate nested comment warning. 1998-10-11 17:14:56 +00:00
libmd add more MLINKS 1999-03-02 22:53:24 +00:00
libmytinfo Fixed CLEANFILES. 1998-12-27 15:04:33 +00:00
libncurses Add missing int to prototypes of mvaddstr and mvaddnstr. 1998-12-10 02:35:24 +00:00
libopie libopie also depends on libmd. Programs using libopie shouldn't have to 1998-10-11 04:45:50 +00:00
libpam Fix breakage for the static a.out case. The a.out linker doesn't 1999-01-22 12:43:42 +00:00
libpcap Fixed CLEANFILES. 1998-12-27 15:04:33 +00:00
libpthread [ The author's description... ] 1999-03-23 05:07:56 +00:00
libradius Allow an alternate to rad_send_request() for programs that 1999-02-05 11:23:44 +00:00
libresolv Don't build elf libresolv.so*, no elf freebsd binaries have used it ever. 1998-10-11 04:21:56 +00:00
librpcsvc Toss publickey.c in the attic and remove it from the Makefile. 1998-05-18 21:59:53 +00:00
libskey Fixed bitrot in synopsis (some const poisoning hadn't reached here). 1999-03-05 15:50:07 +00:00
libss Replace memory leaking instances of realloc with non-leaking reallocf. 1998-09-16 04:17:47 +00:00
libstand Remove float-point dependency from i386's version of setjmp()/longjmp(). 1999-02-12 17:22:30 +00:00
libtacplus Initial import of TACACS+ client library donated by Juniper Networks, Inc. 1998-11-13 00:54:26 +00:00
libtelnet Old stuff laying around: Don't use a function called getstr(), that has 1998-12-16 06:04:29 +00:00
libtermcap Deal with /usr/lib/compat/aout, and that we've been installing things 1998-10-11 04:39:56 +00:00
libutil Get the pid right if a stale lock file exists. 1999-03-11 09:09:20 +00:00
libvgl .Sh AUTHOR -> .Sh AUTHORS. Use .An/.Aq 1998-03-19 07:34:22 +00:00
libwrap Build libwrap - the core to tcp_wrappers. 1999-03-14 17:56:11 +00:00
libxpg4 I have added the support for BIG5 encoding into libc/libxpg4/mklocale. 1998-08-15 12:51:49 +00:00
liby Don't install an elf liby.so[.2] in /usr/lib/compat. We have never had 1998-10-11 04:10:14 +00:00
libz Merge changes from vendor branch (1.1.1 -> 1.1.3) into mainline. 1999-01-10 09:53:51 +00:00
msun Disable building with alpha software completion options until we upgrade 1998-12-24 13:17:58 +00:00
ncurses/ncurses Renamed the generated include file keys.tries to keys.tries.h so 1998-03-20 16:50:08 +00:00
Makefile Build libwrap - the core to tcp_wrappers. 1999-03-14 17:56:11 +00:00
Makefile.inc