软件项目免坑指南

“谁也无法改变现状,唯有无数程序员血洒大地,才能使项目重建天日。”这一点也不夸张,软件项目做烂了就是个坑,参与者也不过是填坑的。就像是在魔兽

DataTable多线程写不安全

如下代码: class test { private DataTable ftable; public test() { ftable = new DataTable(); DataColumn col = new DataColumn("COL_1", typeof(int)); ftable.Columns.Add(col); col = new DataColumn("COL_2", typeof(int)); ftable.Columns.Add(col); for (int i = 1; i < 100; i++) { DataRow row = ftable.NewRow(); row["COL_1"] = i; row["COL_2"] = i * 2; ftable.Rows.Add(row); } } public void AddColTest() { DataColumn col = new DataColumn("COL_Test", typeof(int)); ftable.Columns.Add(col); Parallel.For(0, ftable.Rows.Count, (index)