[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CAB and MiNTnet thoughts

So I'm sitting here waiting for a 300K text file to download (the RFC
for HTTP 1.1, in fact) and it occurs to me - why am I staring at a blank
window, when there's already so much data on my disk? 

So I have an idea - my cache is on a Minix filesystem, so it supports
symbolic links. When retrieving a file, I create a pipe, and create a symlink
to that pipe where CAB expects the file to appear. As I retrieve the file,
I write it to an alternate location, and start writing it to the pipe. I
then return "success" to CAB. This way, CAB can start processing the file
immediately, instead of having to wait until it has completely arrived.
After the transfer is complete, the symlink is deleted and the real file
is renamed into place. In the meantime, CAB will suspend when it tries to
read the pipe and there's no data available yet.

Does this gain anything? If CAB tries to fseek around on the pipe, it will
fail; not having checked yet, I dunno if this is a good idea or not. One
disadvantage is you will no longer get running status on the number of
bytes retrieved, since CAB will think it already has the entire file.

Also, this may be more effort than it's worth, particularly when retrieving
a lot of small files, as opposed to a few huge ones. And, you will still
have to wait if the file is html with inline images & such, because the
images can't be retrieved until after the initial html file is done

I have seen other browser implementations that spawn multiple transfers in
parallel, but I don't see that being particularly useful when your network
link is a single serial line. It will only cause an overall slowdown, since
having interleaved data from multiple connections arriving at once will
defeat TCP header compression & other optimizations.

Anyone else have thoughts on this stuff?

Howard Chu				Principal Member of Technical Staff
hyc@locus.com				PLATINUM technology, Los Angeles Lab