Re: accept() improvements for rt signals

From: Dan Kegel (dank@alumni.caltech.edu)
Date: Tue Feb 22 2000 - 12:18:56 EST


"Stephen C. Tweedie" wrote:
> > On that theme, the form of accept2() where you provide a pre-prepared
> > socket recycled from a previously shut down client has another
> > scalability advantage:
>
> > The kernel does not have to search the fd array to find the smallest
> > free fd value.
>
> Genuis. Pure genuis. Another bottleneck hits the dust. :)
>
> This looks pretty simple to achieve: an accept6() modelled after clone,
> indicating exactly what properties of the old socket to inherit. A
> first attempt looks like:
>
> int accept (int oldfd, struct sockaddr *, int *addrlen,
> int newfd, pid_t sigpid, unsigned int clone_flags)
>
> newfd will be the fd we use for the new socket (with precisely the same
> semantics as dup2); sigpid will be the pid to which we grant ownership
> of the new socket (allowing us to load-balance between threads); and
> clone_flags will be a bitmap indicating what properties of the original
> socket we want to copy to the new one, including the obvious ones:

Just to be clear, the "original socket" here is the listening socket,
right?
Since newfd may already have been closed, presumably it's lost all of its
properties, and can't be the "original socket".

- Dan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:31 EST