lkml.org 
[lkml]   [1998]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Thread implementations...
[been a little busy to keep up with thread]

On 26 Jun 1998, James H. Cloos Jr. wrote:

> <URL:http://www.software.hp.com/STK/man/10.30/sendfile_2.html>

ssize_t sendfile(int s, int fd, off_t offset, size_t nbytes,
const struct iovec *hdtrl, int flags);

...
hdtrl points to a two entry iovec structure. See write(2) for a
description of the iovec structure. The first entry is for header
information. ...

Here, let's look at a typical HTTP response header (numbers added by me):

1 HTTP/1.1 200 OK
2 Date: Sat, 27 Jun 1998 19:08:14 GMT
3 Server: Apache/1.3.1-dev
4 Cache-Control: max-age=3600
4 Expires: Sat, 27 Jun 1998 20:08:14 GMT
4 Last-Modified: Thu, 23 Apr 1998 18:38:20 GMT
4 ETag: "b794e-609-353f8a9c"
4 Accept-Ranges: bytes
4 Content-Length: 1545
4 Content-Type: text/html
5 Connection: close

Each of the numbers in the left-hand column indicate how I've been
planning to break up these headers for the HTTP flow engine (new
front-end for apache). Maybe I'm doing something wrong.

The stuff marked 4 is specific to the resource, and that part of the
header is pre-generated when the object is put into the flow cache.
It never changes as long as the object is in the flow cache.

Number 2, the Date, is handled with extreme care. It will be generated
by a special thread that wakes up once per second. With a couple static
arrays, and rw locks, it's possible to do this without bothering other
threads much at all.

Number 1 and 3 are constant for the flow engine.

5 may be present, not present, or set to "Connection: keep-alive" and
such.

I had planned to do all of these 5 things in separate iovec entries.
This was to avoid reconstructing the headers for each request (only 2
and 5 actually change, although 1 can change if a GET If-Modified-Since
request occurs.) I was hoping to reduce copying... and increase cache
happiness.

The HPUX sendfile won't let me do that.

Dean


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

\
 
 \ /
  Last update: 2005-03-22 13:43    [W:0.172 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site