From owner-freebsd-arch Sat Nov 27 6:30:26 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id E0B5014C9F for ; Sat, 27 Nov 1999 06:30:22 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id PAA08040 for ; Sat, 27 Nov 1999 15:30:21 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id PAA53012 for freebsd-arch@freebsd.org; Sat, 27 Nov 1999 15:30:20 +0100 (MET) Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id 307A214D09 for ; Sat, 27 Nov 1999 03:40:27 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from vigrid.com (pm3-pt37.pcnet.net [206.105.29.111]) by pcnet1.pcnet.com (8.8.7/PCNet) with ESMTP id GAA03816; Sat, 27 Nov 1999 06:40:27 -0500 (EST) Message-ID: <383FC334.F96FDAB1@vigrid.com> Date: Sat, 27 Nov 1999 06:40:36 -0500 From: "Daniel M. Eischen" X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 4.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Julian Elischer Cc: arch@freebsd.org Subject: Re: Threads stuff References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Julian Elischer wrote: > > ok well I'm only sketching out one solutionso don't feel that ai'm > bullying you into anything.. > > in this scheme however there is nothing to say that we can't keep track of > time spent in IO. As long as the UTS was informed of the time spent in the kernel (I suppose via the IO control block?) for each KSE, then that would probably be good enough. Currently under libc_r, it is almost inevitable that every thread switch needs to make a system call or two, even if you ignore setting the signal masks and use _setjmp/_longjmp. We have to call gettimeofday() to get the time, calculate the time that the current thread should be switched out (assuming it doesn't block before then), and make a call to setitimer(). If we are going to try and optimize away the system call needed to resume a thread after its work in the kernel is completed, then let us also look at other ways to eliminate system calls :-) If the upcall that notifies the UTS of unblocked threads also supplies the current time, as well as time spent in the kernel for each completed KSE, then that would eliminate the need to perform gettimeofday(). We still need to schedule some sort of signal (or upcall) to tell us when the current threads quantum has been reached. If we supply a thread_resume_with_quantum(), then we can resume the thread and schedule the signal (or whatever) all in one system call. Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message