lkml.org 
[lkml]   [2000]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Semaphores used for daemon wakeup
Tim Wright wrote:
>
> On Sun, Dec 17, 2000 at 01:06:10PM +0100, Daniel Phillips wrote:
> > This patch illustrates an alternative approach to waking and waiting on
> > daemons using semaphores instead of direct operations on wait queues.
> > The idea of using semaphores to regulate the cycling of a daemon was
> > suggested to me by Arjan Vos. The basic idea is simple: on each cycle
> > a daemon down's a semaphore, and is reactivated when some other task
> > up's the semaphore.
> [...]
> >
> > OK, there it is. Is this better, worse, or lateral?
>
> Well, I have to confess I'm rather fond of this method, but that could have
> something to do with it being how we did it in DYNIX/ptx (Sequent).
> It certainly works, and I find it very clear, but of course I'm biased :-)

I'm curious, is my method of avoiding the deadlock race the same as
yours? My solution is to keep a count of tasks that 'intend' to take
the down():

atomic_inc(&bdflush_waiters);
up(&bdflush_request);
down(&bdflush_waiter);

so that bdflush will issue the correct number of up's even if the waiter
has not yet gone to sleep. IOW, is your approach in DYNIX the same only
in spirit, or in detail?

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.055 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site