Coda File System

Re: LWPs in Coda and native platform threads

From: Robert Watson <>
Date: Mon, 27 Jul 1998 14:19:08 -0400 (EDT)
On Mon, 27 Jul 1998, Jim Doyle wrote:

> I guess I dont understand how LWPs are exploited by Coda... It seems
> to me that your concern is that the non-preemptive nature of these
> user-space threads and exploitation of that feature in the design of
> Coda makes it hard to conceive a port to another Threads API. Maybe
> I dont understand the subtlety of this because I havent looked at
> the code long enough.. It would seem to me that you could retain the
> same control of the threads scheduler by simply using condition
> variables to force a scheduler context change from one thread to 
> another thread... Condition variables are how you do interthread
> communications - this is how you build programs where one thread
> does some work and then passes control to another thread to do
> some other work that you've prepared for it.
> Could you explain what it is that isnt in Pthreads that makes
> this conjecture difficult ?

I think that indeed, it is not hard to stick an LWP emulation layer on top
of pthreads and have the same Coda we have today, and that that would even
be useful.  This, as you suggested, would be emulating non-preemptive
behavior as in LWP via condition variables or such.

However, to go beyond this, one would need to seriously rewrite sections
the internals of Coda to take advantage of real parallelism (SMP,
preemption of non-yielding code).

Shafeeq summarizes this conclusion best, I think, as he has spent a fair
amount of time actually looking at porting pthreads:

> While a drop-in LWP replacement wouldn't be hard, the better thing to do
> would be to make the rest of Coda preemption safe and use pthreads
> directly, since the LWP model allows only one running thread, so the
> benefits of SMP are lost. 
> I think the main reason this hasn't been done yet is that while LWP
> works and isn't impossible to port, there are many other things in a
> less finished state.

  Robert N Watson 

Carnegie Mellon University  
TIS Labs at Network Associates, Inc.
SafePort Network Services       
Received on 1998-07-27 14:25:27