From owner-freebsd-current Sun Jan 31 04:36:22 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA24170 for freebsd-current-outgoing; Sun, 31 Jan 1999 04:36:22 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.26.10.9]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA24143 for ; Sun, 31 Jan 1999 04:36:01 -0800 (PST) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id XAA15248; Sun, 31 Jan 1999 23:35:53 +1100 Date: Sun, 31 Jan 1999 23:35:53 +1100 From: Bruce Evans Message-Id: <199901311235.XAA15248@godzilla.zeta.org.au> To: bde@zeta.org.au, dufault@hda.com Subject: Re: more about yield() versus sched_yield() Cc: current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> Another difference is that it correctly counts context switches as voluntary. > >Good point. The patched version calls maybe_resched(), and I'm >adding the line at "<<<". This counts context switches twice (once as voluntary here, once as involuntary when switch is done on return from the syscall). You could frob the count of involuntary switches here, but the uglyness of that shows that things aren't being done right. A direct switch as in yield() seems best. >(This also will let people who haven't looked at that code >complain about the function interface - it doesn't bother me, >macros could come later.) I might complain about style bugs, and typedefs named priority_type, and magic conversions between priority_type and int. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message