]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
race cond found in test.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 19 Feb 2008 15:49:22 +0000 (15:49 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 19 Feb 2008 15:49:22 +0000 (15:49 +0000)
git-svn-id: file:///svn/unbound/trunk@969 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testcode/asynclook.c

index 05c89517e27155b6a8c86a7b10b79c63b25e18f5..f6b9486faac75e22f1a46e2d84825c114ddf7b70 100644 (file)
        - 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.
index d119192dff636a822ad61d5cec439e96f238fd88..4a5a61960055fc859bd064090dcebe2cf7049597 100644 (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 */