Пример #1
0
        public void Run()
        {
            isCancel = false;
            isRun    = true;
            bool replace;
            bool showNew;

            switch (nowTask)
            {
            case MyTask.ExportData:
                if (mArgs != null && mArgs.Length >= 2)
                {
                    ExportData(mArgs[0], mArgs[1]);
                }
                break;

            case MyTask.CheckUpdate:
                showNew = false;
                if (mArgs != null && mArgs.Length >= 1)
                {
                    showNew = (mArgs[0] == Boolean.TrueString) ? true : false;
                }
                OnCheckUpdate(showNew);
                break;

            case MyTask.CutImages:
                if (mArgs != null && mArgs.Length >= 2)
                {
                    replace = true;
                    if (mArgs.Length >= 2)
                    {
                        if (mArgs[1] == Boolean.FalseString)
                        {
                            replace = false;
                        }
                    }
                    CutImages(mArgs[0], replace);
                }
                break;

            case MyTask.SaveAsMSE:
                if (mArgs != null && mArgs.Length >= 2)
                {
                    replace = false;
                    if (mArgs.Length >= 2)
                    {
                        if (mArgs[1] == Boolean.TrueString)
                        {
                            replace = true;
                        }
                    }
                    SaveMSEs(mArgs[0], cardlist, replace);
                }
                break;

            case MyTask.ReadMSE:
                if (mArgs != null && mArgs.Length >= 2)
                {
                    replace = false;
                    if (mArgs.Length >= 2)
                    {
                        if (mArgs[1] == Boolean.TrueString)
                        {
                            replace = true;
                        }
                    }
                    cardlist = ReadMSE(mArgs[0], replace);
                }
                break;

            case MyTask.ConvertImages:
                if (mArgs != null && mArgs.Length >= 2)
                {
                    replace = true;
                    if (mArgs.Length >= 3)
                    {
                        if (mArgs[2] == Boolean.FalseString)
                        {
                            replace = false;
                        }
                    }
                    ConvertImages(mArgs[0], mArgs[1], replace);
                }
                break;
            }
            isRun    = false;
            lastTask = nowTask;
            nowTask  = MyTask.NONE;
            if (lastTask != MyTask.ReadMSE)
            {
                cardlist = null;
            }
            mArgs = null;
        }
Пример #2
0
 public void Task_ConcurrentQueue()
 {
     MyTask.Test_ConcurrentQueue();
 }
Пример #3
0
        public ActionResult Edit(Guid Id)
        {
            MyTask task = dal.GetTask(Id);

            return(View(task));
        }
Пример #4
0
 public void Task_AsyncAwaitException()
 {
     MyTask.Test_AsyncAwaitException();
 }
Пример #5
0
 public void Task_BlockingCollection()
 {
     MyTask.Test_BlockingCollection();
 }
Пример #6
0
 public void Task_Interlocked()
 {
     MyTask.TestTaskInterlocked();
 }
Пример #7
0
 public void Task_ChildTask()
 {
     MyTask.TestChildTask();
 }
Пример #8
0
 public override void HandleRequest(int flag, ObservableCollection <MyTask> Tasks, MyTask selectedTask)
 {
     if (flag == 3 && selectedTask != null)
     {
         XmlSerialDeSerial x = new XmlSerialDeSerial();
         x.SerializeObject(Tasks, "DbTasks");
         MessageBox.Show("Saved");
         return;
     }
     else if (Successor != null)
     {
         Successor.HandleRequest(flag, Tasks, selectedTask);
     }
 }
Пример #9
0
 public MyDebugTaskNode(MyTask task, Action enabledCallback) : base(task)
 {
     Icon              = Properties.Resources.gears;
     OwnerName         = task.GetType().Name;
     m_enabledCallback = enabledCallback;
 }
Пример #10
0
        public MyExecutionBlock CreateNodeExecutionPlan(MyWorkingNode node, bool initPhase)
        {
            List <IMyExecutable> defaultPlanContent = new List <IMyExecutable>();

            if (!initPhase && PlanSignalTasks)
            {
                defaultPlanContent.Add(new MyIncomingSignalTask(node));
            }

            foreach (string taskName in node.GetInfo().KnownTasks.Keys)
            {
                MyTask task = node.GetTaskByPropertyName(taskName);

                if (task != null && !task.DesignTime && (initPhase && task.OneShot || !initPhase && !task.OneShot))
                {
                    defaultPlanContent.Add(task);
                }
            }

            MyNodeGroup nodeGroup = node as MyNodeGroup;

            if (nodeGroup != null)
            {
                IEnumerable <MyNode> children = nodeGroup.Children.OrderBy(x => x.TopologicalOrder);

                foreach (MyNode childNode in children)
                {
                    MyWorkingNode childWorkingNode = childNode as MyWorkingNode;
                    if (childWorkingNode != null)
                    {
                        defaultPlanContent.Add(CreateNodeExecutionPlan(childWorkingNode, initPhase));
                    }
                }
            }

            if (!initPhase && PlanSignalTasks)
            {
                defaultPlanContent.Add(new MyOutgoingSignalTask(node));
            }

            MyExecutionBlock defaultPlan = new MyExecutionBlock(defaultPlanContent.ToArray());

            defaultPlan.Name = node.Name;

            MyExecutionBlock resultPlan = defaultPlan;

            IMyCustomExecutionPlanner executionPlannerNode = node as IMyCustomExecutionPlanner;

            if (executionPlannerNode != null)
            {
                if (initPhase)
                {
                    resultPlan = executionPlannerNode.CreateCustomInitPhasePlan(defaultPlan);
                }
                else
                {
                    resultPlan = executionPlannerNode.CreateCustomExecutionPlan(defaultPlan);
                }
                resultPlan.Name = defaultPlan.Name;
            }

            if (resultPlan.Name == null)
            {
                resultPlan.Name = node.GetType().Name;
            }

            if (node is MyNodeGroup)
            {
                resultPlan.Name += " (group)";
            }

            // TODO(HonzaS): Rethink this. It's only used in profiling results.
            node.ExecutionBlock = resultPlan;

            return(resultPlan);
        }
Пример #11
0
 public MyDebugTaskNode(MyTask task) : base(task)
 {
     Icon      = Properties.Resources.gears;
     OwnerName = task.GetType().Name;
 }
Пример #12
0
        private void buttonDivideByZeroTask_Click(object sender, EventArgs e)
        {
            MyTask testTask = new MyTask(AllTasks.DivideByZeroTask, null);

            threadPool.AddTaskInQueue(testTask);
        }
Пример #13
0
 public void MarkAsModified(MyTask item)
 {
     Entry(item).State = EntityState.Modified;
 }
Пример #14
0
 public void Post([FromBody] MyTask task)
 {
     _context.Tasks.Add(task);
     _context.SaveChanges();
 }
Пример #15
0
 //设置任务
 public void SetTask(MyTask myTask, Card[] cards, params string[] args)
 {
     nowTask = myTask;
     cardlist = cards;
     mArgs = args;
 }
Пример #16
0
 public override void HandleRequest(int flag, ObservableCollection <MyTask> Tasks, MyTask selectedTask)
 {
     if (flag == 4)
     {
         MyTask t = new MyTask();
         t.Title = "New task";
         Tasks.Add(t);
         List <MyTask> l = new List <MyTask>();
         foreach (MyTask m in Tasks)
         {
             l.Add(m);
         }
         l.Reverse();
         Tasks.Clear();
         for (int i = 0; i < l.Count; i++)
         {
             Tasks.Add(l[i]);
         }
         XmlSerialDeSerial x = new XmlSerialDeSerial();
         x.SerializeObject(Tasks, "DbTasks");
         MessageBox.Show("Added");
         return;
     }
     else if (Successor != null)
     {
         Successor.HandleRequest(flag, Tasks, selectedTask);
     }
 }
Пример #17
0
 public MyTask Add(MyTask newTask)
 {
     context.MyTask.Add(newTask);
     context.SaveChanges();
     return(newTask);
 }
Пример #18
0
        public override void Run(IEnumerable <MyTask> tasks)
        {
            int maxConcurentTasks = 11 + 3;

            ThreadPool.SetMinThreads(maxConcurentTasks, maxConcurentTasks);
            ThreadPool.SetMaxThreads(maxConcurentTasks, maxConcurentTasks);
            int totalToProcess = 0;

            int toProcess = 0;

            int bc2Count = 0;

            int bc3Count = 0;

            BlockingCollection <MyTask> bc1 = new BlockingCollection <MyTask>();

            BlockingCollection <MyTask> bc2 = new BlockingCollection <MyTask>();

            BlockingCollection <MyTask> bc3 = new BlockingCollection <MyTask>();

            Semaphore semaphore1 = new Semaphore(5, 5);
            Semaphore semaphore2 = new Semaphore(3, 3);
            Semaphore semaphore3 = new Semaphore(3, 3);

            foreach (MyTask task in tasks)
            {
                bc1.Add(task);

                Interlocked.Increment(ref toProcess);
            }
            totalToProcess = toProcess;

            bc1.CompleteAdding();

            using (ManualResetEvent resetEvent = new ManualResetEvent(false))
            {
                Task bc1Runner = Task.Run(() =>
                {
                    while (true)
                    {
                        MyTask task = bc1.Take();
                        semaphore1.WaitOne();
                        Task.Run(() =>
                        {
                            {
                                task.DoStepN(1);
                                Console.WriteLine("do " + task.ID + " dostep 1...END");
                                bc2.Add(task);
                                Interlocked.Increment(ref bc2Count);
                            }
                            semaphore1.Release();
                        });
                    }
#pragma warning disable CS0162 // Unreachable code detected
                    Console.WriteLine("bc1 complete!!!!!!");
#pragma warning restore CS0162 // Unreachable code detected
                });


                Task bc2Runner = Task.Run(() =>
                {
                    while (true)
                    {
                        if (bc2Count == totalToProcess)
                        {
                            bc2.CompleteAdding();
                        }

                        Console.WriteLine(bc2.Count);

                        MyTask task = bc2.Take();

                        semaphore2.WaitOne();
                        Task.Run(() =>
                        {
                            {
                                task.DoStepN(2);
                                Console.WriteLine("do " + task.ID + " dostep 2...END");
                                bc3.Add(task);
                                Interlocked.Increment(ref bc3Count);
                            }
                            semaphore2.Release();
                        });
                    }
#pragma warning disable CS0162 // Unreachable code detected
                    Console.WriteLine("bc2 complete!!!!!!");
#pragma warning restore CS0162 // Unreachable code detected
                });


                Task task3Runner = Task.Run(() =>
                {
                    while (true)
                    {
                        if (bc3Count == totalToProcess)
                        {
                            bc3.CompleteAdding();
                        }

                        MyTask task = bc3.Take();

                        semaphore3.WaitOne();
                        Task.Run(() =>
                        {
                            {
                                task.DoStepN(3);
                                Console.WriteLine(task.ID + " dostep 3...");

                                if (Interlocked.Decrement(ref toProcess) == 0)
                                {
                                    resetEvent.Set();
                                }
                            }
                            semaphore3.Release();
                        });
                    }
#pragma warning disable CS0162 // Unreachable code detected
                    Console.WriteLine("bc3 complete!!!!!!");
#pragma warning restore CS0162 // Unreachable code detected
                });


                resetEvent.WaitOne();
            }
        }
Пример #19
0
 public void Task_DeadLock()
 {
     MyTask.TaskDeadLock();
 }
Пример #20
0
 public void Task_ConcurrentDictionary()
 {
     MyTask.Test_ConcurrentDictionary();
 }
Пример #21
0
 public void Task_AsyncAwait()
 {
     MyTask.Test_AsyncAwait();
 }
Пример #22
0
 public void Task_Cancellation()
 {
     MyTask.Task_Cancellation();
 }
Пример #23
0
 public void Task_AsyncAwaitWhenAll()
 {
     MyTask.Test_AsyncAwaitWhenAll();
 }
Пример #24
0
 public void Task_OperationCanceledException()
 {
     MyTask.Task_OperationCanceledException();
 }
Пример #25
0
 public void Task_ConcurrentStack()
 {
     MyTask.Test_ConcurrentStack();
 }
Пример #26
0
 public void Task_ContinueWith()
 {
     MyTask.TestContinueWith();
 }
Пример #27
0
 private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "OutcomeDate")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.OutcomeDate == DateTime.MinValue)
             {
                 e.DisplayText = "";
             }
         }
     }
     else if (e.Column.FieldName == "PercentageCompleteness")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.PercentageCompleteness == 0)
             {
                 e.DisplayText = "";
             }
         }
     }
     else if (e.Column.Name == "colFiscale")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.Customer != null)
             {
                 e.DisplayText = app.Customer.CodiceFiscale;
             }
         }
     }
     else if (e.Column.Name == "colContatti")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.Customer != null)
             {
                 e.DisplayText = app.Customer.Residenza.ToString();
             }
         }
     }
     else if (e.Column.Name == "colTelContatti")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.Customer != null)
             {
                 e.DisplayText = app.Customer.Comunicazione.TelefonoUfficio;
             }
         }
     }
     else if (e.Column.Name == "colCell1")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.Customer != null)
             {
                 e.DisplayText = app.Customer.Comunicazione.Cellulare1;
             }
         }
     }
     else if (e.Column.Name == "colCell2")
     {
         MyTask app = gridView1.GetRow(e.RowHandle) as MyTask;
         if (app != null)
         {
             if (app.Customer != null)
             {
                 e.DisplayText = app.Customer.Comunicazione.Cellulare2;
             }
         }
     }
 }
Пример #28
0
 public void Task_ThreadSafetyViolation()
 {
     MyTask.Task_ThreadSafetyViolation();
 }
Пример #29
0
 //设置任务
 public void SetTask(MyTask myTask, Card[] cards, params string[] args)
 {
     nowTask  = myTask;
     cardlist = cards;
     mArgs    = args;
 }
Пример #30
0
 public void Task_ObjectLock()
 {
     MyTask.TestTaskObjectLock();
 }
Пример #31
0
 public void Run()
 {
     isCancel = false;
     isRun = true;
     bool replace;
     bool showNew;
     switch (nowTask)
     {
         case MyTask.ExportData:
             if (mArgs != null && mArgs.Length >= 2)
             {
                 ExportData(mArgs[0], mArgs[1]);
             }
             break;
         case MyTask.CheckUpdate:
             showNew = false;
             if (mArgs != null && mArgs.Length >= 1)
             {
                 showNew = (mArgs[0] == Boolean.TrueString) ? true : false;
             }
             OnCheckUpdate(showNew);
             break;
         case MyTask.CutImages:
             if (mArgs != null && mArgs.Length >= 2)
             {
                 replace = true;
                 if (mArgs.Length >= 2)
                 {
                     if (mArgs[1] == Boolean.FalseString)
                         replace = false;
                 }
                 CutImages(mArgs[0], replace);
             }
             break;
         case MyTask.SaveAsMSE:
             if (mArgs != null && mArgs.Length >= 2)
             {
                 replace = false;
                 if (mArgs.Length >= 2)
                 {
                     if (mArgs[1] == Boolean.TrueString)
                         replace = true;
                 }
                 SaveMSEs(mArgs[0], cardlist, replace);
             }
             break;
         case MyTask.ReadMSE:
             if (mArgs != null && mArgs.Length >= 2)
             {
                 replace = false;
                 if (mArgs.Length >= 2)
                 {
                     if (mArgs[1] == Boolean.TrueString)
                         replace = true;
                 }
                 cardlist = ReadMSE(mArgs[0], replace);
             }
             break;
         case MyTask.ConvertImages:
             if (mArgs != null && mArgs.Length >= 2)
             {
                 replace = true;
                 if (mArgs.Length >= 3)
                 {
                     if (mArgs[2] == Boolean.FalseString)
                         replace = false;
                 }
                 ConvertImages(mArgs[0], mArgs[1], replace);
             }
             break;
     }
     isRun = false;
     lastTask = nowTask;
     nowTask = MyTask.NONE;
     if(lastTask != MyTask.ReadMSE)
         cardlist = null;
     mArgs = null;
 }
Пример #32
0
 public void Task_Monitor()
 {
     MyTask.TestTaskMonitor();
 }
Пример #33
0
 public void TakeAnswer(MyTask My7Tas_)
 {
     throw new NotImplementedException();
 }
Пример #34
0
        private void btTestSearchText_Click(object sender, RoutedEventArgs e)
        {
            //Dictionary<string, HashSet<uint>> d = new Dictionary<string, HashSet<uint>>();
            //d.Add("t1", null);
            //d.Add("t2", new HashSet<uint> { 4, 5, 6 });

            //var btx = Biser.Encode_DICT_PROTO_STRING_UINTHASHSET(d, Compression.eCompressionType.NoCompression);
            //Dictionary<string, HashSet<uint>> d1 = new Dictionary<string, HashSet<uint>>();

            //Biser.Decode_DICT_PROTO_STRING_UINTHASHSET(btx, d1, Compression.eCompressionType.NoCompression);

            //return;
            if (textsearchengine == null)
            {
                textsearchengine = new DBreezeEngine(@"D:\temp\DBR1\");
            }
            MyTask tsk = null;

            using (var tran = textsearchengine.GetTransaction())
            {
                var resp = tran.TextSearch("TaskText", new DBreeze.TextSearch.TextSearchRequest()
                {
                    // SearchLogicType = DBreeze.TextSearch.TextSearchRequest.eSearchLogicType.OR,
                    SearchWords = "Xamarin"
                });

            }

            return;

            //Testing External indexer concept.
            //Table where we will store Docs to be indexed
            using (var tran = textsearchengine.GetTransaction())
            {

                //we want to use table PendingTextSearchIndexing to communicate with AutomaticIndexer (so we will write into it also)
                tran.SynchronizeTables("Tasks", "TaskText");

                //Storing task
                tsk = new MyTask()
                {
                    Id = 1,
                    Description = "Starting with the .NET Framework version 2.0, well if you derive a class from Random and override the Sample method, the distribution provided by the derived class implementation of the Sample method is not used in calls to the base class implementation of the NextBytes method. Instead, the uniform",
                    Notes = "distribution returned by the base Random class is used. This behavior improves the overall performance of the Random class. To modify this behavior to call the Sample method in the derived class, you must also override the NextBytes method"
                };
                //Inserting task value must be, of course tsk
                tran.Insert<long, byte[]>("Tasks", tsk.Id, null);

                tran.TextInsertToDocument("TaskText", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes,
                    new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, DeferredIndexing = true });

                tsk = new MyTask()
                {
                    Id = 2,
                    Description = "VI guess in Universal Apps for Xamarin you need to include the assembly when loading embedded resources. I had to change",
                    Notes = "I work on.NET for UWP.This is super interesting and I'd well love to take a deeper look at it after the holiday. If "
                };
                tran.Insert<long, byte[]>("Tasks", tsk.Id, null);

                tran.TextInsertToDocument("TaskText", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes,
                  new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, DeferredIndexing = true });

                tran.Commit();
            }

            return;

                //using (var tran = textsearchengine.GetTransaction())
                //{
                //    tsk = new MyTask()
                //    {
                //        Id = 2,
                //        ExternalId = "x2",
                //        Description = "Very second task ",
                //        Notes = "small"
                //    };
                //    sb.Append(tsk.Description + " " + tsk.Notes);
                //    tran.InsertDocumentText("TaskFullTextSearch" + companyId, tsk.Id.To_8_bytes_array_BigEndian(), sb.ToString(), new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false });

                //    tran.Commit();
                //}

                //using (var tran = textsearchengine.GetTransaction())
                //{
                //    var resp = tran.TextSearch("TaskFullTextSearch", new DBreeze.TextSearch.TextSearchRequest()
                //    {
                //        // SearchLogicType = DBreeze.TextSearch.TextSearchRequest.eSearchLogicType.OR,
                //        SearchWords = "review1"
                //    });

                //}
                //return;

                SpeedStatistic.ToConsole = false;
            SpeedStatistic.StartCounter("a");

            //using (var tran = textsearchengine.GetTransaction())
            //{

            //    tsk = new MyTask()
            //    {
            //        Id = 3,
            //        Description = "test review",
            //        Notes = "metro"
            //    };
            //    tran.Insert<long, byte[]>("Tasks", tsk.Id, null);

            //    tran.TextInsertToDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes, new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, });
            //    //tran.TextAppendWordsToDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), "cheater", new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, });
            //    //tran.TextRemoveWordsFromDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), "cheater", new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = true, });

            //    tran.Commit();
            //}
            //return;

            using (var tran = textsearchengine.GetTransaction())
            {

                //we want to store text index in table “TaskFullTextSearch” and task itself in table "Tasks"
                tran.SynchronizeTables("Tasks", "TaskFullTextSearch");

                //Storing task
                tsk = new MyTask()
                {
                    Id = 1,
                    Description = "Starting with the .NET Framework version 2.0, well if you derive a class from Random and override the Sample method, the distribution provided by the derived class implementation of the Sample method is not used in calls to the base class implementation of the NextBytes method. Instead, the uniform",
                    Notes = "distribution returned by the base Random class is used. This behavior improves the overall performance of the Random class. To modify this behavior to call the Sample method in the derived class, you must also override the NextBytes method"
                };
                tran.Insert<long, byte[]>("Tasks", tsk.Id, null);

                //Creating text, for the document search. any word or word part (minimum 3 chars, check TextSearchStorageOptions) from Description and Notes will return us this document in the future
                tran.TextInsertToDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes, new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, });

                tsk = new MyTask()
                {
                    Id = 2,
                    Description = "VI guess in Universal Apps for Xamarin you need to include the assembly when loading embedded resources. I had to change",
                    Notes = "I work on.NET for UWP.This is super interesting and I'd well love to take a deeper look at it after the holiday. If "
                };
                tran.Insert<long, byte[]>("Tasks", tsk.Id, null);
                tran.TextInsertToDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes, new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, });

                tsk = new MyTask()
                {
                    Id = 3,
                    Description = "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met",
                    Notes = "This clause was objected to on the grounds that as people well changed the license to reflect their name or organization it led to escalating advertising requirements when programs were combined together in a software distribution: every occurrence of the license with a different name required a separate acknowledgment. In arguing against it, Richard Stallman has stated that he counted 75 such acknowledgments "
                };
                tran.Insert<long, byte[]>("Tasks", tsk.Id, null);
                tran.TextInsertToDocument("TaskFullTextSearch", tsk.Id.To_8_bytes_array_BigEndian(), tsk.Description + " " + tsk.Notes, new DBreeze.TextSearch.TextSearchStorageOptions() { FullTextOnly = false, });

                //Committing all together.
                //Though its possible to build an automatic indexer for the huge text and call it in parallel thread and here to store only changed documentIDs which must be indexed.
                //All depends upon necessary insert speed.
                tran.Commit();
            }

            SpeedStatistic.PrintOut("a",true);
        }