- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
private async Task CountResultAsync(IProgress<bool> progress)
{
object sync = new object();
await Task.Run(() => Parallel.For(0, _dataList.Count, i =>
{
lock (sync)
{
var index = _dataList.FindIndex(m => m.FullPath.Equals(_dataList[i].FullPath));
_dataList[index] = new GridModel()
{
FullPath = _dataList[i].FullPath,
Name = _dataList[i].Name,
Checksum = GetFileChecksum(_dataList[i].FullPath),
IsCompleted = true
};
}
}));
}
Когда кто-то пытается написать параллельный код, но что-то идет не так.
guest8 19.06.2019 23:39 # −999
PA3yMHblu_nemyx 21.06.2019 12:48 # 0
guest8 21.06.2019 15:09 # −999
guest8 21.06.2019 15:09 # −999
guest8 20.06.2019 02:03 # −999
CnEPMOBOP 21.06.2019 22:42 # −101
✅ Create native business WEB-Applications
✅ Harder! Faster! Better! A new way to software developing!
✅ New free modern-look IDE with syntax check and autocomplete
✅Join community today
cmepmop 21.06.2019 22:49 # 0