Ejemplo n.º 1
0
 private void RefreshItems(bool displayThreadTimes)
 {
     AsyncProcessor[] procs = AsyncProcessor.GetAllPooledProcessors();
     _listView.BeginUpdate();
     try
     {
         _listView.Items.Clear();
         foreach (AsyncProcessor proc in procs)
         {
             ListViewItem item = new ListViewItem();
             item.Tag  = proc;
             item.Text = proc.ThreadName;
             item.SubItems.Add(proc.ThreadPriority.ToString());
             if (displayThreadTimes)
             {
                 item.SubItems.Add(proc.GetKernelTime().ToString());
                 item.SubItems.Add(proc.GetUserTime().ToString());
             }
             _listView.Items.Add(item);
         }
     }
     finally
     {
         _listView.EndUpdate();
     }
 }
Ejemplo n.º 2
0
        public void Execute(IActionContext context)
        {
            AsyncProcessor tiAP = null;

            AsyncProcessor[] pool = AsyncProcessor.GetAllPooledProcessors();
            foreach (AsyncProcessor ap in pool)
            {
                if (ap.ThreadName == "TextIndex AsyncProcessor")
                {
                    tiAP = ap;
                }
            }
            if (tiAP != null)
            {
                tiAP.RunUniqueJob(new MethodInvoker(DumpTrie));
            }
        }