I recently learned this bit of code the other day...
and it has drastically improved a few of my programs and it has me wondering if this could also be used on nested for statements?Code:Directory.GetFiles(fileLoc).AsParallel.WithDegreeOfParallelism(3).ForAll(Sub(path) theWorker(path))
would it be possible to do something like this?Code:For x As Integer = 0 To 99 For y As Integer = 0 To 99 For z As Integer = 0 To 99 dowork(x, y, z) Next Next Next
or would I have to do something like this to actually make it work?Code:For x As Integer = 0 To 99 For y As Integer = 0 To 99 Parallel.For(0,99,Sub(z) dowork(x,y,z).WithDegreeOfParallelism(3) Next Next
If someone could teach me it would be greatly appreciated : )Code:Dim thelist As New List(Of String) For x As Integer = 0 To 99 thelist.Add(x) Next For x As Integer = 1 To 26 For y As Integer = 0 To 23 thelist.AsParallel.WithDegreeOfParallelism(3).ForAll(Sub(z) dowork(x,y,z)) Next Next
Thanks -Z




Reply With Quote
