From owner-cvs-all Fri Oct 13 15:12:56 2000 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 32C3A37B502; Fri, 13 Oct 2000 15:12:49 -0700 (PDT) Received: (from deischen@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id PAA03099; Fri, 13 Oct 2000 15:12:49 -0700 (PDT) (envelope-from deischen@FreeBSD.org) Message-Id: <200010132212.PAA03099@freefall.freebsd.org> From: Daniel Eischen Date: Fri, 13 Oct 2000 15:12:48 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc_r/uthread pthread_private.h uthread_attr_setschedparam.c uthread_cond.c uthread_create.c uthread_detach.c uthread_execve.c uthread_exit.c uthread_fd.c uthread_file.c uthread_fork.c uthread_gc.c uthread_getschedparam.c uthread_info.c uthread_init.c ... X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG deischen 2000/10/13 15:12:48 PDT Modified files: lib/libc_r/uthread pthread_private.h uthread_attr_setschedparam.c uthread_cond.c uthread_create.c uthread_detach.c uthread_execve.c uthread_exit.c uthread_fd.c uthread_file.c uthread_fork.c uthread_gc.c uthread_getschedparam.c uthread_info.c uthread_init.c uthread_jmp.c uthread_join.c uthread_kern.c uthread_mutex.c uthread_priority_queue.c uthread_sem.c uthread_sendfile.c uthread_setschedparam.c uthread_sig.c uthread_sigaction.c uthread_sigmask.c uthread_signal.c uthread_sigprocmask.c uthread_sigwait.c uthread_write.c uthread_yield.c Log: Implement zero system call thread switching. Performance of thread switches should be on par with that under scheduler activations. o Timing is achieved through the use of a fixed interval timer (ITIMER_PROF) to count scheduling ticks instead of retrieving the time-of-day upon every thread switch and calculating elapsed real time. o Polling for I/O readiness is performed once for each scheduling tick instead of every thread switch. o The non-signal saving/restoring versions of setjmp/longjmp are used to save and restore thread contexts. This may allow the removal of _THREAD_SAFE macros from setjmp() and longjmp() - needs more investigation. Change signal handling so that signals are handled in the context of the thread that is receiving the signal. When signals are dispatched to a thread, a special signal handling frame is created on top of the target threads stack. The frame contains the threads saved state information and a new context in which the thread can run. The applications signal handler is invoked through a wrapper routine that knows how to restore the threads saved state and unwind to previous frames. Fix interruption of threads due to signals. Some states were being improperly interrupted while other states were not being interrupted. This should fix several PRs. Signal handlers, which are invoked as a result of a process signal (not by pthread_kill()), are now called with the code (or siginfo_t if SA_SIGINFO was set in sa_flags) and sigcontext_t as received from the process signal handler. Modify the search for a thread to which a signal is delivered. The search algorithm is now: o First thread found in sigwait() with signal in wait mask. o First thread found sigsuspend()'d on the signal. o Current thread if signal is unmasked. o First thread found with signal unmasked. Collapse machine dependent support into macros defined in pthread_private.h. These should probably eventually be moved into separate MD files. Change the range of settable priorities to be compliant with POSIX (0-31). The threads library uses higher priorities internally for real-time threads (not yet implemented) and threads executing signal handlers. Real-time threads and threads running signal handlers add 64 and 32, respectively, to a threads base priority. Some other small changes and cleanups. PR: 17757 18559 21943 Reviewed by: jasone Revision Changes Path 1.45 +297 -123 src/lib/libc_r/uthread/pthread_private.h 1.6 +5 -1 src/lib/libc_r/uthread/uthread_attr_setschedparam.c 1.27 +52 -16 src/lib/libc_r/uthread/uthread_cond.c 1.26 +39 -62 src/lib/libc_r/uthread/uthread_create.c 1.12 +4 -3 src/lib/libc_r/uthread/uthread_detach.c 1.12 +1 -4 src/lib/libc_r/uthread/uthread_execve.c 1.17 +42 -40 src/lib/libc_r/uthread/uthread_exit.c 1.17 +61 -11 src/lib/libc_r/uthread/uthread_fd.c 1.15 +38 -4 src/lib/libc_r/uthread/uthread_file.c 1.20 +1 -4 src/lib/libc_r/uthread/uthread_fork.c 1.13 +3 -3 src/lib/libc_r/uthread/uthread_gc.c 1.5 +3 -2 src/lib/libc_r/uthread/uthread_getschedparam.c 1.16 +2 -2 src/lib/libc_r/uthread/uthread_info.c 1.25 +48 -16 src/lib/libc_r/uthread/uthread_init.c 1.4 +82 -73 src/lib/libc_r/uthread/uthread_jmp.c 1.13 +23 -10 src/lib/libc_r/uthread/uthread_join.c 1.31 +262 -328 src/lib/libc_r/uthread/uthread_kern.c 1.24 +49 -17 src/lib/libc_r/uthread/uthread_mutex.c 1.6 +13 -9 src/lib/libc_r/uthread/uthread_priority_queue.c 1.7 +2 -1 src/lib/libc_r/uthread/uthread_sem.c 1.3 +3 -3 src/lib/libc_r/uthread/uthread_sendfile.c 1.7 +5 -2 src/lib/libc_r/uthread/uthread_setschedparam.c 1.27 +831 -415 src/lib/libc_r/uthread/uthread_sig.c 1.12 +8 -7 src/lib/libc_r/uthread/uthread_sigaction.c 1.6 +14 -5 src/lib/libc_r/uthread/uthread_sigmask.c 1.5 +2 -2 src/lib/libc_r/uthread/uthread_signal.c 1.10 +3 -47 src/lib/libc_r/uthread/uthread_sigprocmask.c 1.15 +5 -7 src/lib/libc_r/uthread/uthread_sigwait.c 1.17 +2 -2 src/lib/libc_r/uthread/uthread_write.c 1.5 +1 -4 src/lib/libc_r/uthread/uthread_yield.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message