From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 3 Oct 2005 14:02:01 -0400 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] userspace netlog style log file in fs? In-Reply-To: <200510031748.j93HmA806250@zamenhof.cs.utwente.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200510031748.j93HmA806250@zamenhof.cs.utwente.nl> Topicbox-Message-UUID: 939d744a-ead0-11e9-9d60-3106f5b1d025 > I guess this amounts to > - keeping a ring buffer of log messages (a la netlog) > - keeping a queue of 'pending' read's -- > read is the only thing for which completion > may have to be delayed, right? Yes. > - pending reads should 'complete' when stuff > is logged (i.e. something to read appears) > - pending reads should be cleaned away > when the fid is clunked > - deal with flushes? Yes! Otherwise you can't kill a process that is blocked reading the log file. > - deal with slow readers that read slower > than the log gets updated, i.e. at a certain > moment they may ask for data that already has > been overwritten Tough for them. > I found inspiration in /sys/src/9/ip/netlog.c and > /sys/src/cmd/ssh/sshnet.c See also /sys/src/9/port/log.c. Sshnet is a good example of getting the flushes right. Russ