in reply to Re^3: Passing objects between threads...any solutions? (shared objects)
in thread Passing objects between threads...any solutions ?
RE: pool of resource objects
I've managed to take your notion and run w/ it, and may even CPAN a module in the near future to do what I need, namely, create a ResourcePool object that acts as a pool/factory for objects of a specified type. Each thread gets the ResourcePool by default when the thread clones everything at create() time. Then the thread can either allocate() a fresh resource object from the ResourcePool, or use a scalar ID to get() an existing object. The thread either explicitly free()'s the object, or the resource's DESTROY() frees the object back to the pool when it goes out of scope (note the free() may only mean it is disassociated from the thread, but remains allocate()'d by other threads).
Thanks for getting me headed in the right direction...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Passing objects between threads...any solutions? (shared objects)
by BrowserUk (Patriarch) on Jun 10, 2005 at 21:35 UTC |