Changeset 4352
- Timestamp:
- 11/18/09 13:34:39 (8 months ago)
- Location:
- trunk/varnish-cache/bin/varnishd
- Files:
-
- 3 modified
-
cache_pool.c (modified) (6 diffs)
-
heritage.h (modified) (1 diff)
-
mgt_pool.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/varnish-cache/bin/varnishd/cache_pool.c
r4235 r4352 433 433 434 434 static void 435 wrk_breed_flock(struct wq *qp )435 wrk_breed_flock(struct wq *qp, const pthread_attr_t *tp_attr) 436 436 { 437 437 pthread_t tp; … … 446 446 if (qp->nthr >= nthr_max) { 447 447 VSL_stats->n_wrk_max++; 448 } else if (pthread_create(&tp, NULL, wrk_thread, qp)) {448 } else if (pthread_create(&tp, tp_attr, wrk_thread, qp)) { 449 449 VSL(SLT_Debug, 0, "Create worker thread failed %d %s", 450 450 errno, strerror(errno)); … … 477 477 { 478 478 unsigned u, w; 479 pthread_attr_t tp_attr; 480 481 /* Set the stacksize for worker threads */ 482 AZ(pthread_attr_init(&tp_attr)); 479 483 480 484 THR_SetName("wrk_herder"); … … 482 486 while (1) { 483 487 for (u = 0 ; u < nwq; u++) { 488 if (params->wthread_stacksize != UINT_MAX) 489 AZ(pthread_attr_setstacksize(&tp_attr, 490 params->wthread_stacksize)); 491 492 wrk_breed_flock(wq[u], &tp_attr); 493 484 494 /* 485 495 * Make sure all pools have their minimum complement … … 487 497 for (w = 0 ; w < nwq; w++) 488 498 while (wq[w]->nthr < params->wthread_min) 489 wrk_breed_flock(wq[w] );499 wrk_breed_flock(wq[w], &tp_attr); 490 500 /* 491 501 * We cannot avoid getting a mutex, so we have a … … 495 505 Lck_CondWait(&herder_cond, &herder_mtx); 496 506 Lck_Unlock(&herder_mtx); 497 wrk_breed_flock(wq[u]);498 507 } 499 508 } -
trunk/varnish-cache/bin/varnishd/heritage.h
r4328 r4352 94 94 unsigned wthread_purge_delay; 95 95 unsigned wthread_stats_rate; 96 unsigned wthread_stacksize; 96 97 97 98 unsigned overflow_max; -
trunk/varnish-cache/bin/varnishd/mgt_pool.c
r4216 r4352 191 191 EXPERIMENTAL, 192 192 "3", "requests per request" }, 193 { "thread_pool_stack", 194 tweak_uint, &master.wthread_stacksize, 64*1024, UINT_MAX, 195 "Worker thread stack size. In particular on 32bit systems " 196 "you may need to tweak this down to fit many threads into " 197 "the limited address space.\n", 198 EXPERIMENTAL, 199 "-1", "bytes" }, 193 200 { NULL, NULL, NULL } 194 201 };
