Example #1
0
        // A scheduler which always schedules into priority zero
        // always queue 0
        protected override void SetUp()
        {
            Configuration conf = new Configuration();

            conf.SetInt("ns." + FairCallQueue.IpcCallqueuePriorityLevelsKey, 2);
            fcq = new FairCallQueue <Schedulable>(5, "ns", conf);
        }
Example #2
0
            public long[] GetOverflowedCalls()
            {
                FairCallQueue obj = this.delegate_.Get();

                if (obj == null)
                {
                    return(new long[] {  });
                }
                return(obj.GetOverflowedCalls());
            }
Example #3
0
            public int[] GetQueueSizes()
            {
                FairCallQueue obj = this.delegate_.Get();

                if (obj == null)
                {
                    return(new int[] {  });
                }
                return(obj.GetQueueSizes());
            }
Example #4
0
        public virtual void TestDrainToWithLimit()
        {
            Configuration conf = new Configuration();

            conf.SetInt("ns." + FairCallQueue.IpcCallqueuePriorityLevelsKey, 2);
            FairCallQueue <Schedulable> fcq2 = new FairCallQueue <Schedulable>(10, "ns", conf);

            fcq.SetScheduler(alwaysZeroScheduler);
            fcq2.SetScheduler(alwaysZeroScheduler);
            // Start with 3 in fcq, to be drained
            for (int i = 0; i < 3; i++)
            {
                fcq.Offer(MockCall("c"));
            }
            fcq.DrainTo(fcq2, 2);
            Assert.Equal(1, fcq.Count);
            Assert.Equal(2, fcq2.Count);
        }
Example #5
0
 public void SetDelegate(FairCallQueue obj)
 {
     this.delegate_ = new WeakReference <FairCallQueue>(obj);
     this.revisionNumber++;
 }