Click here to Skip to main content
15,894,646 members
Articles / Programming Languages / C#

Managed I/O Completion Ports (IOCP)

Rate me:
Please Sign up or sign in to vote.
4.92/5 (76 votes)
26 Apr 200621 min read 420K   5.3K   259  
A fully managed .NET implementation of Win32 IOCP's waitable event queuing mechanism.
using System;

using Sonic.Net.DataStructures.LockFree;

namespace Sonic.Net.ThreadPoolTaskFramework
{
	/// <summary>
	/// Factory class used to create poolable Task objects.
	/// </summary>
	public abstract class TaskFactory : PoolableObjectFactory
	{
		#region Public Constructor(s)
		
		/// <summary>
		/// Default constructor
		/// </summary>
		public TaskFactory()
		{
			_objTaskPool = new ObjectPool(this,true);
		}

		#endregion

        #region Public Methods

        /// <summary>
		/// Add the completed task object to the task object pool
		/// </summary>
		/// <param name="t">Task object that completed execution</param>
		public void Done(Task t)
		{
			_objTaskPool.AddToPool(t);
		}

		#endregion

		#region Private Data Members

		protected ObjectPool _objTaskPool;

		#endregion
	}
}

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
India India
Software Professional with 14+ Years of experience in design & development of server products using Microsoft Technologies.

Woked/Working on server side product development using Managed C++ & C#, including Thread pools, Asynchronous Procedure Calls (APC), Inter Process Communication (IPC) using named pipes, Lock Free data structures in C++ & .Net, etc.

Comments and Discussions