summaryrefslogtreecommitdiffstats
path: root/winsup/cygserver/bsd_helper.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-11-10 15:04:06 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-11-10 15:04:06 +0000
commit2d015bd67c8ab20d1b0f9bd1d84a1dc8fd42310f (patch)
treeed140634c5d17c42b35cd1931f300925aa97e0b8 /winsup/cygserver/bsd_helper.cc
parent8032f81502f37d0fc6a0a2f7902411d80b189331 (diff)
downloadcygnal-2d015bd67c8ab20d1b0f9bd1d84a1dc8fd42310f.tar.gz
cygnal-2d015bd67c8ab20d1b0f9bd1d84a1dc8fd42310f.tar.bz2
cygnal-2d015bd67c8ab20d1b0f9bd1d84a1dc8fd42310f.zip
* bsd_helper.cc (securityinit): New function. Move initialization
of security related variables from ipcinit here. * bsd_helper.h (securityinit): Add prototype. * cygserver.cc (main): Call securityinit right after wincap.init. * process.cc (process_cache::process): Fix maximum process condition. * README: Add description for new -p/--process-cache option. * bsd_helper.cc (default_tun_check): Add kern.srv.process_cache_size entry to tunable_params. Set max value of kern.srv.request_threads to 310. * cygserver.cc (SERVER_VERSION): Set to 1.20. (print_usage): Print usage of new parameter -p. (main): Add process cache parameter handling. Accomodate new max value of request threads. * cygserver.conf: Add kern.srv.process_cache_size tunable parameter. Accomodate new max value of kern.srv.request_threads. * process.cc: Fix a comment. (process_cache::process_cache): Add max process cache size parameter. Change _cache_add_trigger to manual reset event. (struct pcache_wait_t): New struct used as parameter to pcache_wait_thread. (pcache_wait_thread): New thread function used for threaded process cache. (process_cache::wait_for_processes): Use threaded waiting if number of processes to wait for is bigger than 62. Always check all processes to avoid race under heavy load. (process_cache::sync_wait_array): Remove useless assert. Reset _cache_add_trigger right at the start since it's manual reset now. Accomodate threaded waiting. * process.h (process_cache::process_cache): Add max_procs parameter. (process_cache::_max_process_count): New member. (process_cache::_wait_array: Raise to allow up to 5 wait threads. (process_cache::_process_array): Ditto.
Diffstat (limited to 'winsup/cygserver/bsd_helper.cc')
-rw-r--r--winsup/cygserver/bsd_helper.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc
index 9fb3c9bfa..53ae4a070 100644
--- a/winsup/cygserver/bsd_helper.cc
+++ b/winsup/cygserver/bsd_helper.cc
@@ -248,6 +248,14 @@ SECURITY_ATTRIBUTES sec_all_nih = { sizeof (SECURITY_ATTRIBUTES),
&sec_all_nih_sd,
FALSE };
+void
+securityinit ()
+{
+ InitializeSecurityDescriptor (&sec_all_nih_sd, SECURITY_DESCRIPTOR_REVISION);
+ SetSecurityDescriptorDacl (&sec_all_nih_sd, TRUE, 0, FALSE);
+ init_admin_sid ();
+}
+
/* Global vars, determining whether the IPC stuff should be started or not. */
tun_bool_t support_sharedmem = TUN_UNDEF;
tun_bool_t support_msgqueues = TUN_UNDEF;
@@ -256,10 +264,6 @@ tun_bool_t support_semaphores = TUN_UNDEF;
void
ipcinit ()
{
- InitializeSecurityDescriptor (&sec_all_nih_sd, SECURITY_DESCRIPTOR_REVISION);
- SetSecurityDescriptorDacl (&sec_all_nih_sd, TRUE, 0, FALSE);
-
- init_admin_sid ();
mtx_init (&Giant, "Giant", NULL, MTX_DEF);
msleep_init ();
ipcexit_event = CreateEvent (NULL, TRUE, FALSE, NULL);
@@ -553,8 +557,9 @@ default_tun_check (tun_struct *that, char *value, const char *fname)
static tun_struct tunable_params[] =
{
/* SRV */
- { "kern.srv.cleanup_threads", TUN_INT, {0}, {1}, {16}, default_tun_check},
- { "kern.srv.request_threads", TUN_INT, {0}, {1}, {64}, default_tun_check},
+ { "kern.srv.cleanup_threads", TUN_INT, {0}, {1}, {32}, default_tun_check},
+ { "kern.srv.request_threads", TUN_INT, {0}, {1}, {310}, default_tun_check},
+ { "kern.srv.process_cache_size", TUN_INT, {0}, {1}, {310}, default_tun_check},
{ "kern.srv.sharedmem", TUN_BOOL, {TUN_UNDEF}, {TUN_FALSE}, {TUN_TRUE}, default_tun_check},
{ "kern.srv.msgqueues", TUN_BOOL, {TUN_UNDEF}, {TUN_FALSE}, {TUN_TRUE}, default_tun_check},
{ "kern.srv.semaphores", TUN_BOOL, {TUN_UNDEF}, {TUN_FALSE}, {TUN_TRUE}, default_tun_check},