2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

1250. [bug] When processing events (non-threaded) only allow

the task one chance to use to use its quantum.
This commit is contained in:
Mark Andrews
2002-07-19 03:39:44 +00:00
parent ff30cdeb78
commit 0d993c02ba
3 changed files with 18 additions and 3 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: task.c,v 1.87 2002/03/29 01:25:04 marka Exp $ */
/* $Id: task.c,v 1.88 2002/07/19 03:39:43 marka Exp $ */
/*
* Principal Author: Bob Halley
@@ -111,7 +111,7 @@ struct isc_taskmgr {
/* Locked by task manager lock. */
unsigned int default_quantum;
LIST(isc_task_t) tasks;
LIST(isc_task_t) ready_tasks;
isc_tasklist_t ready_tasks;
#ifdef ISC_PLATFORM_USETHREADS
isc_condition_t work_available;
isc_condition_t exclusive_granted;
@@ -726,6 +726,7 @@ dispatch(isc_taskmgr_t *manager) {
isc_task_t *task;
#ifndef ISC_PLATFORM_USETHREADS
unsigned int total_dispatch_count = 0;
isc_tasklist_t ready_tasks;
#endif /* ISC_PLATFORM_USETHREADS */
REQUIRE(VALID_MANAGER(manager));
@@ -780,6 +781,9 @@ dispatch(isc_taskmgr_t *manager) {
* unlocks. The while expression is always protected by the lock.
*/
#ifndef ISC_PLATFORM_USETHREADS
ISC_LIST_INIT(ready_tasks);
#endif
LOCK(&manager->lock);
while (!FINISHED(manager)) {
#ifdef ISC_PLATFORM_USETHREADS
@@ -965,11 +969,18 @@ dispatch(isc_taskmgr_t *manager) {
* were usually nonempty, the 'optimization'
* might even hurt rather than help.
*/
#ifdef ISC_PLATFORM_USETHREADS
ENQUEUE(manager->ready_tasks, task,
ready_link);
#else
ENQUEUE(ready_tasks, task, ready_link);
#endif
}
}
}
#ifndef ISC_PLATFORM_USETHREADS
ISC_LIST_APPENDLIST(manager->ready_tasks, ready_tasks, ready_link);
#endif
UNLOCK(&manager->lock);
}