Programming Tutorials on XHTML, CSS, JavaScript, JQuery, JSON, Python, Django, Amazon Web Services, ASP.NET, Web Forms, and SQL
Monday, July 2, 2012
Difference between object pooling and connection pooling
How does object pooling and connection pooling differ?
In Object pooling, you can control the number of connections. In connection pooling, you can control the maximum number reached.
When using connection pooling, if there is nothing in the pool, a connection is created since the creation is on the same thread.
In object pooling, the pool decides the creation of an object depending on whether the maximum is reached which in case if it is, the next available object is returned. However, this could increase the time complexity if the object is heavy.
Sunday, July 1, 2012
Object Pooling in .NET
What is an object pool in .NET?
An object pool is a container of objects that holds a list of other objects that are ready to be used. It keeps track of following:
Objects that are currently in use
The number of objects the pool holds
Whether this number should be increased
The request for the creation of an object is served by allocating an object from the pool.
This reduces the overhead of creating and re-creating objects each time an object creation is required.
Why is an Object Pool required
Why is an Object Pool required?
To enhance performance and reduce the load of creating new objects, instead re using existing objects stored in memory pool.
Object Pool is a container of objects that are for use and have already been created. Whenever an object creation request occurs, the pool manager serves the request by allocating an object from the pool. This minimizes the memory consumption and system's resources by recycling and re-using objects.
When the task of an object is done, it is sent to the pool rather than being destroyed. This reduces the work for garbage collector and fewer memory allocations occur.
To enhance performance and reduce the load of creating new objects, instead re using existing objects stored in memory pool.
Object Pool is a container of objects that are for use and have already been created. Whenever an object creation request occurs, the pool manager serves the request by allocating an object from the pool. This minimizes the memory consumption and system's resources by recycling and re-using objects.
When the task of an object is done, it is sent to the pool rather than being destroyed. This reduces the work for garbage collector and fewer memory allocations occur.
GetCommandLineArgs() method in C# .NET
What is the use of GetCommandLineArgs() method in C#.NET?
With GetCommandLineArgs() method, the command line arguments can be accessed.
The value returned is an array of strings.
Compare C# .NET Generics and C++ Templates
How does C#.NET Generics and C++ Templates compare?
C# generics and templates in C++ are more or less similar syntactically.
C# Generic types are strong typed. C++ Templates are loosely typed.
C# Generic types are instantiated at the runtime. C++ templates are instantiated at the compile time.
C# Generic types do not permit the type parameters to have default values. C++ templates do.
Subscribe to:
Posts (Atom)