* 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.
This commit is contained in:
Corinna Vinschen
2005-11-10 15:04:06 +00:00
parent 8032f81502
commit 2d015bd67c
8 changed files with 213 additions and 64 deletions

View File

@ -1,6 +1,6 @@
/* process.h
Copyright 2001, 2002, 2003, 2004 Red Hat Inc.
Copyright 2001, 2002, 2003, 2004, 2005 Red Hat Inc.
Written by Robert Collins <rbtcollins@hotmail.com>
@ -141,7 +141,7 @@ class process_cache
friend class submission_loop;
public:
process_cache (unsigned int initial_workers);
process_cache (const size_t max_procs, const unsigned int initial_workers);
~process_cache ();
class process *process (pid_t cygpid, DWORD winpid,
@ -157,13 +157,14 @@ private:
submission_loop _submitter;
size_t _processes_count;
size_t _max_process_count;
class process *_processes_head; // A list sorted by winpid.
// Access to the _wait_array and related fields is not thread-safe,
// since they are used solely by wait_for_processes () and its callees.
HANDLE _wait_array[MAXIMUM_WAIT_OBJECTS];
class process *_process_array[MAXIMUM_WAIT_OBJECTS];
HANDLE _wait_array[5 * MAXIMUM_WAIT_OBJECTS];
class process *_process_array[5 * MAXIMUM_WAIT_OBJECTS];
HANDLE _cache_add_trigger; // Actually both add and remove.
CRITICAL_SECTION _cache_write_access; // Actually both read and write access.