Esempio n. 1
0
 public void Stop()
 {
     for (int i = 0; i < concurrents; ++i)
     {
         DataDispatcher <T> rps = pools[i];
         if (rps != null)
         {
             rps.Stop();
         }
         pools[i] = null;
     }
 }
Esempio n. 2
0
 public void Init()
 {
     lock (pools)
     {
         for (int i = 0; i < concurrents; ++i)
         {
             DataDispatcher <T> rps = new DataDispatcher <T>(action);
             rps.Start();
             pools[i] = rps;
         }
     }
 }
Esempio n. 3
0
        public void Add(T a)
        {
            int which = CalcWhich(a);

            which = Math.Abs(which);
            which = which % concurrents;
            DataDispatcher <T> rps = pools[which];

            if (rps != null)
            {
                rps.Add(a);
            }
        }