On Wed, Aug 07, 2002 at 06:56:43AM -0700, G?ran Thyni wrote:
> Update of /cvsroot/freenet/freenet/src/freenet/fs/dir
> In directory usw-pr-cvs1:/tmp/cvs-serv11477
> 
> Modified Files:
>       NativeFSDirectory.java 
> Log Message:
> First stab at an implementation
> It compiles
> It runs
> It probably does NOT work at all!!

I'm afraid the final statement is probably the truth here.

In order for the Buffer implementation to do it's job, it needs to
support "sliding locks". That is to say: if somebody starts reading a
buffer while is being written to, you need to make sure that the reader
can read as much as possible, but that it stays behind the writer by
wait()ing when it caches up. It also needs to do vice versa: if somebody
starts overwriting a buffer while it is being read from, you need to make
sure that the writer can write as much as possible but then wait()s when
it caches up with the reader.

There can be an arbitrary number of readers, but AFAIK (though I can't
swear to it) there is only one writer at a time.

-- 

Oskar Sandberg
oskar at freenetproject.org

_______________________________________________
devl mailing list
devl at freenetproject.org
http://hawk.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to