race cond found in test.

git-svn-id: file:///svn/unbound/trunk@969 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2008-02-19 15:49:22 +00:00
parent 1b403f6ee1
commit 7b8218b2a2
2 changed files with 12 additions and 1 deletions

View file

@ -10,6 +10,15 @@
- perform several reads per UDP operation. This improves performance
in DoS conditions, and costs very little in normal conditions.
improves cache response +50%, and recursions +10%.
- modified asynclook test. because the callback from async is not
in any sort of lock (and thus can use all library functions freely),
this causes a tiny race condition window when the last lock is
released for a callback and a new cancel() for that callback.
The only way to remove this is by putting callbacks into some
lock window. I'd rather have the small possibility of a callback
for a cancelled function then no use of library functions in
callbacks. Could be possible to only outlaw process() and wait()
in callbacks, by adding another lock, but I'd rather not.
18 February 2008: Wouter
- patch to unbound-host from Jan-Piet Mens.

View file

@ -273,7 +273,9 @@ ext_thread(void* arg)
if(i > 100) {
r = ub_cancel(inf->ctx, async_ids[i-100]);
checkerr("ub_cancel", r);
async_ids[i-100]=0;
}
if(i > 200) {
async_ids[i-200]=0;
}
} else if(inf->thread_num > NUMTHR/2) {
/* async */