Coda File System

Re: LWPs in Coda and native platform threads

From: Shafeeq Sinnamohideen <shafeeq_at_cyrus.watson.org>
Date: Mon, 27 Jul 1998 12:02:32 -0400 (EDT)
On Mon, 27 Jul 1998, Robert Watson wrote:
> On the other hand, I'd love to see pthreads support in Coda, I just
> suspect that fixing the current-day concurrency problems is not going to
> be an easy task.
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. 

> Does Coda currently use blocking DNS calls?  I suspect it just calls the
> libc gethostbyname/etc, which (without using native threading) can result
> in considerable blocking.
I don't know if this would cause much trouble, since in RPC2 everything is
done by IP, you'd have only the inital gethostbyname. 
For file I/O, LWP hast the idea of not blocking the entire process
by doing a select unless all threads are blocked on an IOMGR_select, which
causes the problem that if you have a thread doing a long-running
computation, the other thread's IO will start only when the first thread
decides to do IO. Since the RPC2 SocketListenr is a LWP thread, in the
case where a server is busy, it should return BUSY to a client request,
but occasionaly the the worker thead will run without blocking for long
enough that once the SocketListener's select is done, the request has
timedout and the client thinks the server is dead. For this reason, I
think that an implementation of LWP and RPC2 on pthreads would help since
IO would be handled by pthreads  and having the SocketListener as a
preemptive pthread, not LWP, would be safe, and reduce latency. 

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.

Shafeeq
Received on 1998-07-27 12:16:31