diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:51:40 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-19 14:51:40 +0400 |
commit | c0f8e15295371ae69b38185d3ee5659cdd1af386 (patch) | |
tree | 7a550dcc6b6e5026efc850be4a69023708379d75 /source/blender/blenlib/BLI_threads.h | |
parent | efa836531e171028870ee50bcebc4e56a17b536b (diff) |
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
Diffstat (limited to 'source/blender/blenlib/BLI_threads.h')
-rw-r--r-- | source/blender/blenlib/BLI_threads.h | 1 |
1 files changed, 1 insertions, 0 deletions
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); |