Ejemplo n.º 1
0
 public LimitedPriorityQueue(IPriorityConverter <P> converter)
 {
     this.converter = converter;
     this.queueList = new LockFreeQueue <T> [converter.PriorityCount];
     for (int i = 0; i < queueList.Length; i++)
     {
         queueList[i] = new LockFreeQueue <T>();
     }
 }
Ejemplo n.º 2
0
        public MultiqueueManager(uint mainFiber, [CanBeNull] IPriorityConverter converter = null)
        {
            MainFiber = mainFiber;
            Converter = converter ?? new ExponentPriorityConverter();

            Queues = new PriorityAwareQueue <Process> [Process.PriorityLevelsNumber];
            for (int index = 0; index < Process.PriorityLevelsNumber; index += 1)
            {
                Queues[index] = new PriorityAwareQueue <Process>(index);
            }
        }