From 7b8218b2a234a51cf5d918bdf5eb9b2a1655c20e Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Tue, 19 Feb 2008 15:49:22 +0000 Subject: [PATCH] race cond found in test. git-svn-id: file:///svn/unbound/trunk@969 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 9 +++++++++ testcode/asynclook.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 05c89517e..f6b9486fa 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/testcode/asynclook.c b/testcode/asynclook.c index d119192df..4a5a61960 100644 --- a/testcode/asynclook.c +++ b/testcode/asynclook.c @@ -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 */ -- 2.47.2