Beispiel #1
0
    /// <summary>
    /// Create new IOCP Task Scheduler, the completion port is provided. The user is responsible to dispose the completion port at the end of the use.
    /// </summary>
    /// <param name="completionPort">Completion port the Task Scheduler will use as the blocking method</param>
    /// <param name="numAvailableThreads">Number of threads that will be created by the task scheduler</param>
    public IOCPTaskScheduler(CompletionPort completionPort, int numAvailableThreads)
      : this(numAvailableThreads)
    {
      m_completionPort = completionPort;
      m_ownCompletionPort = false;

      Start();
    }
Beispiel #2
0
    /// <summary>
    /// Create new IOCP TaskScheduler, the completion port will be created and own by the Task Scheduler.
    /// </summary>
    /// <param name="numAvailableThreads">Number of threads that will be created by the task scheduler</param>
    /// <param name="maxConcurrencyLevel">The maximum number of threads that the operation system can allow to curcurrently process I/O completion packets.</param>    
    public IOCPTaskScheduler(int numAvailableThreads, int maxConcurrencyLevel)
      : this(numAvailableThreads)
    {
      m_completionPort = new CompletionPort((uint)maxConcurrencyLevel);
      m_ownCompletionPort = true;

      Start();
    }
        /// <summary>
        /// Create new IOCP Task Scheduler, the completion port is provided. The user is responsible to dispose the completion port at the end of the use.
        /// </summary>
        /// <param name="completionPort">Completion port the Task Scheduler will use as the blocking method</param>
        /// <param name="numAvailableThreads">Number of threads that will be created by the task scheduler</param>
        public IOCPTaskScheduler(CompletionPort completionPort, int numAvailableThreads)
            : this(numAvailableThreads)
        {
            m_completionPort    = completionPort;
            m_ownCompletionPort = false;

            Start();
        }
        /// <summary>
        /// Create new IOCP TaskScheduler, the completion port will be created and own by the Task Scheduler.
        /// </summary>
        /// <param name="numAvailableThreads">Number of threads that will be created by the task scheduler</param>
        /// <param name="maxConcurrencyLevel">The maximum number of threads that the operation system can allow to curcurrently process I/O completion packets.</param>
        public IOCPTaskScheduler(int numAvailableThreads, int maxConcurrencyLevel)
            : this(numAvailableThreads)
        {
            m_completionPort    = new CompletionPort((uint)maxConcurrencyLevel);
            m_ownCompletionPort = true;

            Start();
        }
Beispiel #5
0
 public void BindToCompletionPort(CompletionPort completionPort)
 {
     completionPort.AssociateFileHandle(this.Handle);
 }
Beispiel #6
0
 public void BindToCompletionPort(CompletionPort completionPort)
 {
   completionPort.AssociateFileHandle(this.Handle);
 }