]> err.no Git - varnish/commit
Rewrite the worker thread pool code.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 14:52:04 +0000 (14:52 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 10 Jul 2006 14:52:04 +0000 (14:52 +0000)
commite2f62ab47ad935ccc8d45bdd7b231e4289548260
tree51ff56176c0068f4e5c5a71cd96eb94a359ab19d
parentb79b36ef389a944be951d4a088ef62110248ee5d
Rewrite the worker thread pool code.

Assign prefix WRK to the worker pool.

Introduce a struct workreq since the prefetcher (when it happens) will
not have a session to pass in.

The worker threads get a cond_var each and are hung from a list in
most recently used order.

When a request is queued and the worker thread list is not empty,
tickle the cond_var of the first one.

If no threads were availble the max number of threads is not reached,
try to start another worker thread.

If the max was reached or the start filed (likely due to out of memory)
indicate overflow and let the existing pool deal with it.

Create only the minimum requested number of threads initially.

Allow specification of the timeout before a dynamic worker thread commits
suicide to be specified with -w.

Default parameters are -w1,UINT_MAX,10 {min, max, timeout}

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@409 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishd/cache_main.c
varnish-cache/bin/varnishd/cache_pool.c
varnish-cache/bin/varnishd/heritage.h
varnish-cache/bin/varnishd/varnishd.c
varnish-cache/bin/varnishlog/varnishlog.c
varnish-cache/include/shmlog_tags.h
varnish-cache/include/stat_field.h