ucc::ReusableAllocator Class Reference

Class for resource bound memory pools between threads. More...

#include <thread.h>

Inheritance diagram for ucc::ReusableAllocator:

Inheritance graph
[legend]
Collaboration diagram for ucc::ReusableAllocator:

Collaboration graph
[legend]

Protected Member Functions

 ReusableAllocator ()
 Initialize reusable allocator through a conditional.
ReusableObjectnext (ReusableObject *object)
 Get next reusable object in the pool.
void release (ReusableObject *object)
 Release resuable object.

Protected Attributes

ReusableObjectfreelist
unsigned waiting

Detailed Description

Class for resource bound memory pools between threads.

This is used to support a memory pool allocation scheme where a pool of reusable objects may be allocated, and the pool renewed by releasing objects or back. When the pool is used up, a pool consuming thread then must wait for a resource to be freed by another consumer (or timeout). This class is not meant to be used directly, but rather to build the synchronizing control between consumers which might be forced to wait for a resource.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 740 of file thread.h.


Constructor & Destructor Documentation

ucc::ReusableAllocator::ReusableAllocator (  )  [protected]

Initialize reusable allocator through a conditional.

Zero free list.


Member Function Documentation

ReusableObject* ucc::ReusableAllocator::next ( ReusableObject object  )  [inline, protected]

Get next reusable object in the pool.

Parameters:
object from list.
Returns:
next object.

Definition at line 756 of file thread.h.

void ucc::ReusableAllocator::release ( ReusableObject object  )  [protected]

Release resuable object.

Parameters:
object being released.


The documentation for this class was generated from the following file:

Generated on Mon Jul 27 21:11:23 2009 for UCommon by  doxygen 1.5.9