Click here to Skip to main content
15,891,473 members
Articles / Programming Languages / C# 4.0

Implementing a Generic Object Pool in .NET

Rate me:
Please Sign up or sign in to vote.
4.95/5 (25 votes)
1 Feb 2013CPOL17 min read 85.1K   1.9K   64  
A walk-through an implementation of a Generic Object Pool that is much more.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectPool", "ObjectPool\ObjectPool.csproj", "{B5106212-8593-4599-B966-113DCB9F8F35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectPoolTester", "ObjectPoolTester\ObjectPoolTester.csproj", "{AAE3C3EB-A29B-44C1-8CFE-2B7745ED5F7D}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{B5106212-8593-4599-B966-113DCB9F8F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{B5106212-8593-4599-B966-113DCB9F8F35}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{B5106212-8593-4599-B966-113DCB9F8F35}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{B5106212-8593-4599-B966-113DCB9F8F35}.Release|Any CPU.Build.0 = Release|Any CPU
		{AAE3C3EB-A29B-44C1-8CFE-2B7745ED5F7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{AAE3C3EB-A29B-44C1-8CFE-2B7745ED5F7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{AAE3C3EB-A29B-44C1-8CFE-2B7745ED5F7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{AAE3C3EB-A29B-44C1-8CFE-2B7745ED5F7D}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
Israel Israel
I'm a Consultant at Sela Group, love planning distributed systems from the ground up, designing and implementing infrastructure components in a performance-oriented approach.
I have a real passion for performance tuning, troubleshooting, .Net internals and multi-threading patterns and an enthusiastic Windows Phone application developer (Author of Windows Phone Bazaar - www.wp-bazaar.com/).

I'm speaking at Sela Developer Practice conference about CLR 4.5 Improvments in May, come to say hello.
http://seladeveloperpractice.com/

Subscribe to my blog:
http://blogs.microsoft.co.il/blogs/OfirMakmal/

Comments and Discussions