Re: Thread implementations...

Larry McVoy (lm@bitmover.com)
Fri, 26 Jun 1998 08:21:15 -0700


: Yes: Maybe error handling could be done this way:
:
: splice( from, to, __u64 size, struct error *errors )
:
: struct error {
: int actually_read;
: int actually_writen;
: int error_read;
: int error_write;
: }
:
: if, and only if kernel encounters a error, it writes it into
: structure.

[...]

: Data that were read but not written should probably be lost. If we
: don't like this, we could pass pointer/len pair so kernel could write
: unwritten data somewhere. But I think we should better lose that data.

I'm not sure this was obvious - let me be clear. The kernel interfaces
are pull() and push(), i.e., you pull a cookie representing a list of
pages from one file descriptor and you push the cookie on another file
descriptor.

There are a lot of reasons for doing it this way, your error handling
comments are one of them.

Other reasons include things like an ftp that 'knows' that the disks
are striped and you need a 2MB chunk of data to get the stripe going;
it can do this

for (got = 0; got < 2MB; got = bytes(cookie)) {
cookie = pull(socket_fd, args, cookie);
}
push(disk_fd, cookie);

splice() as a interface is just syntactic sugar to make easy things
easy.

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