4
J'utilise la méthode Action<object>.BeginInvoke()
, utilise-t-elle le pool de threads ou non?C#, IAsyncResult et le pool de threads
je le code C#:
List<FileHash> hashList1 = hashList.Where((x, ind) => ind % 2 == 0).ToList();
List<FileHash> hashList2 = hashList.Where((x, ind) => ind % 2 == 1).ToList();
Action<object> oddWork = CalcHash;
Action<object> evenWork = CalcHash;
IAsyncResult evenHandle = evenWork.BeginInvoke(hashList1, null, null);
IAsyncResult oddHandle = oddWork.BeginInvoke(hashList2, null, null);
evenWork.EndInvoke(evenHandle);
oddWork.EndInvoke(oddHandle);
est la piscine de fil utilisé dans les coulisses ou non? Ou le système crée-t-il des threads normaux?