A dataSet(global variable) is shared between two serial threads. one thread change the dataset, and the other thread save the dataSet to DB2. In the later thread, one action is copy the shared dataset( use the DataSet.Copy()) . After the previous thread run once. the later thread is very slowly. the time used on the copy action is about 22 seconds. But if the previous thread stoped, the time exhausted on copy action is 5 seconds.
the code of copy action showed as follows:
Thanks in advance
the code of copy action showed as follows:
Code:
public static void SynchronizeFromPlan(DataSet update, DataSet orDataSet) { sychronized = false; if (update == null && orDataSet == null) return; AddDataSetIncreasement(update, false, System.DateTime.Now); if (!sychronized && orDataSet != null) { AddDataSetIncreasement([B]orDataSet.Copy[/B](), true, System.DateTime.Now); sychronized = true; } }
Comment