diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-16 17:04:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-16 17:04:48 +0000 |
commit | b924ba9cebfa6b720ee7878dbf894e1d63990fef (patch) | |
tree | 024662d91faa53717d8996c4fa8aeeb47bec74c1 /libs/pbd/pbd | |
parent | 63a25adb9eff719aa8bb9b96855b239e8c0e0099 (diff) |
some explanatory text for CrossThreadPool, so that it is possible (maybe) to understand its purpose without divine intervention
git-svn-id: svn://localhost/ardour2/branches/3.0@13671 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r-- | libs/pbd/pbd/pool.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libs/pbd/pbd/pool.h b/libs/pbd/pbd/pool.h index fc8454cee7..58c5861d23 100644 --- a/libs/pbd/pbd/pool.h +++ b/libs/pbd/pbd/pool.h @@ -78,7 +78,18 @@ class MultiAllocSingleReleasePool : public Pool class PerThreadPool; -/** A per-thread pool of data */ +/** Management of a per-thread pool of data that is allocated by one thread and + * freed by one other thread. Not safe for use when there is more than 1 + * reader and 1 writer. + * + * This is basically a wrapper around a thread-local storage instance of a + * ringbuffer, made safe for use in the case where multiple threads allocate + * from the ringbuffer and a single thread "frees" the allocations. + * + * Rather than using locks, each thread has its own ringbuffer (and associated + * data), and so it calls alloc(), passes a pointer to the result of the alloc + * to another thread, which later calls push() to "free" it. + */ class CrossThreadPool : public Pool { public: @@ -99,7 +110,7 @@ class CrossThreadPool : public Pool }; /** A class to manage per-thread pools of memory. One object of this class is instantiated, - * and then it is used to create per-thread pools as required. + * and then it is used to create per-thread pools for 1 or more threads as required. */ class PerThreadPool { |