I have a zipping program that reads information from a XML file. The xml file contains the source or each file, the destination for each file, and a title for each 'job'.
I am trying to get the actual zipping process to run on multiple threads using Parallel.ForEac h
So far i have (code is shortened for your consideration)
I get a HUGE error around the Parallel code. "AmbiguousMatch Exeption was unhandled
I've never tried to implement multithreading before, so this is all brand new to me. Is there any guidance one of you may bestow upon me?
I am trying to get the actual zipping process to run on multiple threads using Parallel.ForEac h
So far i have (code is shortened for your consideration)
Code:
Dim JobNodes As XmlNodeList = doc.GetElementsByTagName("Job")
For Each JobNode In JobNodes
Dim Destin = JobNode.SelectNodes("Destination")
Parallel.ForEach(Destin,Sub(item)
//code to do zipping
end sub)
Code:
Overload resolution failed because no Public 'ForEach' can be called with these arguments:
'Public Shared Function ForEach(Of TSource)(source As OrderablePartitioner(Of TSource), body As Action(Of TSource,ParallelLoopState,Long)) As System.Threading.Tasks.ParallelLoopResult':
Type argument inference fails for argument matching parameter 'source'.
Type argument inference fails for argument matching parameter 'body'.