Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Jan 2001 17:56:02 -0500
From:      Jake Burkholder <jburkhol@home.com>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        Jason Evans <jasone@canonware.com>, arch@FreeBSD.ORG
Subject:   Re: Condition variable patch for review 
Message-ID:  <20010103225603.03B1EBA7D@io.yi.org>
In-Reply-To: Message from Daniel Eischen <eischen@vigrid.com>  of "Fri, 29 Dec 2000 14:58:11 EST." <Pine.SUN.3.91.1001229144027.29714A-100000@pcnet1.pcnet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On 29 Dec 2000, Jason Evans wrote:
> > There is a patch that implements condition variables (mostly written by
> > Jake Burkholder) at:
> > 
> > http://people.freebsd.org/~jasone/diffs/condvar.diff
> 
> Comments:
> 
> Get rid of the 'pri' parameter.  Why is it needed, and if so,
> is it needed in the common case?  Look for other ways to accomplish
> what you need without dirtying the CV interface and making it
> non-standard.  This is the same comment I have about the mutex
> interface and needing to pass the mutex type to every operation.
> Please, let's see this eliminated before 5.0-release, otherwise
> we are stuck with it as an API.

I'm not sure that it can be removed if condition variables are
to be used where sleep is now.  Maybe it can if the re-write of the
kernel scheduler to support kses amounts to more than s/proc/kse/.
What it does is give processes a priority jolt when they wake up,
so they get to run Real Soon.  Look at the priority values that are
passed in to tsleep for an example.

I don't care either way as long as it works.

> 
> Identify which functions are part of our kernel API.  I would
> think that cv_waitq_empty and cv_waitq_remove would not be
> part of this interface.  I assume cv_waitq_remove will eventually
> take a struct thread (or something) instead of a struct proc.
> I'd rather see this as a macro since it's usage should be
> limited.

It parallels unsleep.  I don't see any reason to make it a macro.
It should only be used in one place, in setrunnable when the process
that's passed in is on a condition variable queue.

> 
> I prefer cv_timedwait over cv_twait...
> 
> Other than that, I am happy that we finally have condition
> variables :-)
> 
> -- 
> Dan Eischen
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-arch" in the body of the message




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010103225603.03B1EBA7D>