diff options
author | jeff <jeff@FreeBSD.org> | 2007-12-16 06:21:20 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-12-16 06:21:20 +0000 |
commit | 4ec9caf00c407884fc51ff18adb8ff16a5eb75c0 (patch) | |
tree | e3b97a4fccf98fcc3311ea54b086b57edb1abb4d /sys/kern/kern_thread.c | |
parent | 436e8270ebc964cc1f1effe79ac5c10e92e78f7b (diff) | |
download | FreeBSD-src-4ec9caf00c407884fc51ff18adb8ff16a5eb75c0.zip FreeBSD-src-4ec9caf00c407884fc51ff18adb8ff16a5eb75c0.tar.gz |
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
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r-- | sys/kern/kern_thread.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 93ff5a7..3338005 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/sched.h> #include <sys/sleepqueue.h> +#include <sys/selinfo.h> #include <sys/turnstile.h> #include <sys/ktr.h> #include <sys/umtx.h> @@ -206,6 +207,7 @@ thread_fini(void *mem, int size) turnstile_free(td->td_turnstile); sleepq_free(td->td_sleepqueue); umtx_thread_fini(td); + seltdfini(td); } /* |