Ejemplo n.º 1
0
 /// <summary>
 ///   Creates a new instance of the <see cref="WorkQueue"/> class.
 /// </summary>
 public WorkQueue()
 {
     queue = new HighPriorityQueue();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///   Creates a new instance of the <see cref="WorkThreadPool"/> class with the
        ///   specified <see cref="MinThreads"/> and <see cref="MaxThreads"/>.
        /// </summary>
        /// <param name="minThreads">
        ///   The mininum number of threads.
        /// </param>
        /// <param name="maxThreads">
        ///   The maximum number of threads.
        /// </param>
        /// <seealso cref="Default"/>
        public WorkThreadPool(int minThreads, int maxThreads)
        {
            if (0 >= maxThreads)
            throw new ArgumentOutOfRangeException("maxThreads", maxThreads, "Must be greater than zero.");

             workQueue = new HighPriorityQueue();
             workers = new ArrayList(maxThreads);

             this.maxThreads = maxThreads;
             MinThreads = minThreads;
        }
Ejemplo n.º 3
0
 public static HighPriorityQueue Syncronized(HighPriorityQueue P)
 {
     return(new HighPriorityQueue(ArrayList.Synchronized(P.InnerList), P.Comparer, false));
 }
Ejemplo n.º 4
0
 public static HighPriorityQueue Syncronized(HighPriorityQueue P)
 {
     return new HighPriorityQueue(ArrayList.Synchronized(P.InnerList),P.Comparer,false);
 }