From c0f8e15295371ae69b38185d3ee5659cdd1af386 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 19 Aug 2013 10:51:40 +0000 Subject: Speedup for guarded allocator - Re-arrange locks, so no actual memory allocation (which is relatively slow) happens from inside the lock. operation system will take care of locks which might be needed there on it's own. - Use spin lock instead of mutex, since it's just list operations happens from inside lock, no need in mutex here. - Use atomic operations for memory in use and total used blocks counters. This makes guarded allocator almost the same speed as non-guarded one in files from Tube project. There're still MemHead/MemTail overhead which might be bad for CPU cache utilization --- source/blender/blenlib/BLI_threads.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/blenlib/BLI_threads.h') diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 154986936a2..38ad0827246 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -50,6 +50,7 @@ struct ListBase; /*this is run once at startup*/ void BLI_threadapi_init(void); +void BLI_threadapi_exit(void); void BLI_init_threads(struct ListBase *threadbase, void *(*do_thread)(void *), int tot); int BLI_available_threads(struct ListBase *threadbase); -- cgit v1.2.3