Questions tagged [objectpool]
30 questions
1
vote
1 answer
C# Protobuf .NET Using Preexisting Byte Array
So I am working with Protobufs in .NET and I am trying to incorporate them with a buffer pool and AsyncSocketEventArgs pool. The buffer pool assigns sections of a huge byte array to the event args.
So, the problem, I can't figure out a way to have…

guitar80
- 716
- 6
- 19
0
votes
3 answers
Object pool: abstract super-class or generic?
In my project, I want to use object pool for different types of objects — with similar behavior, but different pool sizes.
Should I create generic class for a pool and interface to apply to created objects, or should I create abstract pool class…

Max Yankov
- 12,551
- 12
- 67
- 135
0
votes
0 answers
Pressing the button does not create an object from the ObjectPool
I created an event in the button when pressed, put there the Shoot function from the code below. When appearing on the scene, the object that should shoot bullets initializes them, but at the press of a button does not make them active, but if you…

Rollis
- 93
- 8
0
votes
1 answer
DefaultObjectPool do not dispose objects
c# documentation says:
When DefaultObjectPoolProvider is used and T implements IDisposable:
Items that are not returned to the pool will be disposed.
I've try some test app to check this out.
Looks like it's not disposing, why?
Example code:
using…

Timur Lemeshko
- 2,747
- 5
- 27
- 39
0
votes
3 answers
Does object pool pattern requires creation of objects before they even needed
If I use object pool design pattern, do I have to create the objects before that anyone needs them, or that I can create every object only when someone needs it, and then (after he used it), put it in the pool?
Thus, to start with an empty pool, and…

Dani
- 719
- 1
- 7
- 14
0
votes
1 answer
Smart pointers Object pool test application fails at finish/exit
I have written a multi-threaded app in Qt/C++11 , Windows.
The idea was to have and recycle some strings from a pool, using smart pointers.
Here is stringpool.cpp:
#include "stringpool.h"
QMutex StringPool::m_mutex;
int…

scuberula
- 35
- 1
- 10
0
votes
1 answer
Object Pooling and CSLA Framework
I have an application that follows the basic methodoligy in the CSLA framework. Specificly, the objects know how to maintain their state and how to create, update, delete themselves. The car class shows this idea.
public class Car
{
public int…

Brig
- 10,211
- 12
- 47
- 71
0
votes
1 answer
Arrays and Linked Lists in java
I've created four classes
ObjectPool.java
NodePool.java
Node.java
ArrayLinkedList.java
Class NodePool inherits from class ObjectPool and provides implementations of methods create() and reset().
Class Node has the usual doubly-linked list…

Ahad Siddiqui
- 331
- 1
- 2
- 13
0
votes
1 answer
Design pattern: Object pool of connections
Recently I started researching more information about the object pool design pattern and I ran into questions that I couldn't found them an answer.
the idea of the object pool pattern is to save expensive resources by reusing them. for examle the…

Shir
- 1
- 1
0
votes
1 answer
Andengine - Object pool or generic pool optimisation
I am creating a game which generates many sprites at some point such as bullets.
I am using object pooling which is generic pool in andengine.
But the problem I am facing is it lags when the object are created for the first time. As for the first…

Sandeep R
- 2,284
- 3
- 25
- 51
0
votes
2 answers
Eliminate abruptly closed sockets from the pool, Java
Assume there is a Java implementation of Object Pool and the objects are successfully connected TCP Sockets.
I keep a "Clean-Up" thread at the Pool level (ConnectionFactory) that checks every N mins that whether the pool is being idle for some M…

Kana
- 21
- 3
0
votes
1 answer
Populating an object pool on JAR load
I have a core JAR that provides some functionality and hence used in lots of other apps as well - desktop apps, web apps etc. Now this core JAR maintains an object pool containing objects that are computationally expensive to create. The object pool…

Aayush Puri
- 1,789
- 3
- 15
- 19
0
votes
2 answers
C++ object pool: program crashes when using malloc
I am trying to make a simple object pool and i cant get it to work .
My code crashes when using malloc to allocate space for a dynamic array of template's type
my code:
template
class ObjectPool{
public:
gltAtlasRenderer* br;
…

SteveL
- 3,331
- 4
- 32
- 57
0
votes
3 answers
Use boost::object_pool can not quit clearly. Am I misusing?
I use boost::object_pool in my program, but I found some problems, it can not quit.
Below is the code. Don't suggest me use boost::pool. The boost::pool is no problem, just discuss the boost::object_pool. Could anybody help me?
#include…

superK
- 3,932
- 6
- 30
- 54
-2
votes
1 answer
Does ArrayList represent an Object Pool Pattern?
I want to know if ArrayList represent an Object Pool Pattern. It has an array of Object inside. And all objects of ArrayList can frequently be reused.

Arkasha
- 117
- 2
- 12