我想同步創建+5個線程,所以不應該有任何併發錯誤。
代碼:BSoD創建線程時
System.Threading.Thread t = new System.Threading.Thread(proc);
t.Start();//==t.BlueScreen();
t.Join();
是黑暗的特徵?
我做錯了什麼?
操作系統:Microsoft Windows Vista中(不幸)64
語言:C#3.0 | 4.0
.NET版本:3.5 | 4
編輯:
Personel[] spersonel;
PROC:
void proc()
{
spersonel = Personel.GetRows(GetThreadSafeDataConnection());
}
Personel:
internal static Personel[] GetRows(System.Data.SqlClient.SqlConnection Connection)
{
int i = 0;
int c = SomeOtherGODClass.Val_int(SomeGODClass.ExecuteScalar("Select Count(*) from Personel", Connection).ToString());
Personel[] Rs = new Personel[c];
System.Data.SqlClient.SqlDataReader sdr = SomeGODClass.ExecuteReader("Select * from Personel", Connection);
while (sdr.Read()) Rs[i++] = new Personel(sdr);
sdr.Close();
if (Rs.Length > 1) mergeSort(ref Rs);
return Rs;
}
OMG!http://stackoverflow.com/questions/1711037適用於我(但我沒有做任何網絡事情)。 – Behrooz 2010-04-17 17:18:24