diff options
author | Jeff Roberson <jeff@FreeBSD.org> | 2007-12-16 06:21:20 +0000 |
---|---|---|
committer | Jeff Roberson <jeff@FreeBSD.org> | 2007-12-16 06:21:20 +0000 |
commit | ace8398da0f88280810bae970996cf32d94dd310 (patch) | |
tree | e3b97a4fccf98fcc3311ea54b086b57edb1abb4d /sys/sys/socketvar.h | |
parent | 53bfc2ecaf24e523c1ea0507152847618914022e (diff) | |
download | src-ace8398da0f88280810bae970996cf32d94dd310.tar.gz src-ace8398da0f88280810bae970996cf32d94dd310.zip |
Refactor select to reduce contention and hide internal implementation
details from consumers.
- Track individual selecters on a per-descriptor basis such that there
are no longer collisions and after sleeping for events only those
descriptors which triggered events must be rescaned.
- Protect the selinfo (per descriptor) structure with a mtx pool mutex.
mtx pool mutexes were chosen to preserve api compatibility with
existing code which does nothing but bzero() to setup selinfo
structures.
- Use a per-thread wait channel rather than a global wait channel.
- Hide select implementation details in a seltd structure which is
opaque to the rest of the kernel.
- Provide a 'selsocket' interface for those kernel consumers who wish to
select on a socket when they have no fd so they no longer have to
be aware of select implementation details.
Tested by: kris
Reviewed on: arch
Notes
Notes:
svn path=/head/; revision=174647
Diffstat (limited to 'sys/sys/socketvar.h')
-rw-r--r-- | sys/sys/socketvar.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 83ef09438a7e..bc8df7b9fb84 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -546,6 +546,8 @@ int sosetopt(struct socket *so, struct sockopt *sopt); int soshutdown(struct socket *so, int how); void sotoxsocket(struct socket *so, struct xsocket *xso); void sowakeup(struct socket *so, struct sockbuf *sb); +int selsocket(struct socket *so, int events, struct timeval *tv, + struct thread *td); #ifdef SOCKBUF_DEBUG void sblastrecordchk(struct sockbuf *, const char *, int); |