diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 21:11:37 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-10-03 21:11:37 +0000 |
commit | 27e828564328ee5270450729bbb6902f6f62ba47 (patch) | |
tree | 1070cd10e6352100d6a8c0aa7edfdf99e61e0e15 /nscd/nscd_conf.c | |
parent | 4401d759051714fcc016a146685f3c13bed49442 (diff) | |
download | glibc-27e828564328ee5270450729bbb6902f6f62ba47.tar glibc-27e828564328ee5270450729bbb6902f6f62ba47.tar.gz glibc-27e828564328ee5270450729bbb6902f6f62ba47.tar.bz2 glibc-27e828564328ee5270450729bbb6902f6f62ba47.zip |
Update.
Dynamically create new threads if necessary.
* nscd/connections.c (fd_ready): If no thread available for processing
the request, create a new one unless the limit is reached.
(start_threads): Check errors from pthread_create.
* nscd/nscd.h: Declare max_nthreads.
* nscd/nscd_conf.c: Parse max-nthreads entry.
* nscd/nscd.conf: Add max-threads entry.
* nscd/nscd_stat.c: Print current and maximum number of threads.
Diffstat (limited to 'nscd/nscd_conf.c')
-rw-r--r-- | nscd/nscd_conf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nscd/nscd_conf.c b/nscd/nscd_conf.c index 591dea8d64..d21f2fc501 100644 --- a/nscd/nscd_conf.c +++ b/nscd/nscd_conf.c @@ -184,6 +184,10 @@ nscd_parse_file (const char *fname, struct database_dyn dbs[lastdb]) if (nthreads == -1) nthreads = MAX (atol (arg1), lastdb); } + else if (strcmp (entry, "max-threads") == 0) + { + max_nthreads = MAX (atol (arg1), lastdb); + } else if (strcmp (entry, "server-user") == 0) { if (!arg1) @@ -282,6 +286,10 @@ cannot get current working directory: %s; disabling paranoia mode"), } } + /* Enforce sanity. */ + if (max_nthreads < nthreads) + max_nthreads = nthreads; + /* Free the buffer. */ free (line); /* Close configuration file. */ |