Re: Thread implementations...

MOLNAR Ingo (mingo@valerie.inf.elte.hu)
Sat, 27 Jun 1998 08:00:27 +0200 (MET DST)


On Fri, 26 Jun 1998, Dean Gaudet wrote:

> Consider an HTTP proxy. When a new entity is being cached, it's desirable
> to "tee" the data coming from the origin server -- one copy going to disk,
> and N copies going to clients requesting the object. This is pretty easy
> to accomplish with mmap() or pull()/push()... increasingly difficult to
> accomplish with sendfile() without going to disk first.

it's not that hard to accomplish this (proxying, squid) with sendfile()
either. You first send it to the local cache-file, then to the client.
Linux just dirtifies those pages but doesnt write them out immediately, so
sending to the file does not mean immediate IO. Then you can sendfile()
the content to clients, one each (possibly done from multiple threads).
Given the typical squid object size is 10-20k, it will probably stay in at
least L2 cache. Also, squid/proxy might want to filter/transform the
object nontrivially before sending it to clients, so a "'tee' in the
kernel" approach is not an all that generic interface, while sendfile()
still fits into the picture.

-- mingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu