Click here to Skip to main content
15,867,939 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralMessage Removed Pin
27-Oct-10 8:33
flflshop27-Oct-10 8:33 
GeneralRe: Problem in UDP socket connection. Pin
LloydA11127-Oct-10 8:39
LloydA11127-Oct-10 8:39 
QuestionHow to tell the difference of Null value or true or false for Yes/No field in access database from vb.net Pin
Andraw Tang1-Sep-10 11:28
Andraw Tang1-Sep-10 11:28 
AnswerRe: How to tell the difference of Null value or true or false for Yes/No field in access database from vb.net Pin
Luc Pattyn1-Sep-10 12:54
sitebuilderLuc Pattyn1-Sep-10 12:54 
GeneralRe: How to tell the difference of Null value or true or false for Yes/No field in access database from vb.net Pin
Andraw Tang1-Sep-10 13:01
Andraw Tang1-Sep-10 13:01 
GeneralRe: How to tell the difference of Null value or true or false for Yes/No field in access database from vb.net Pin
Andraw Tang1-Sep-10 13:02
Andraw Tang1-Sep-10 13:02 
GeneralRe: How to tell the difference of Null value or true or false for Yes/No field in access database from vb.net Pin
Luc Pattyn1-Sep-10 13:40
sitebuilderLuc Pattyn1-Sep-10 13:40 
QuestionTrying to Understand .NET 4 Parallelization Pin
Dominick Marciano1-Sep-10 6:41
professionalDominick Marciano1-Sep-10 6:41 
In my program there is a function that loops through a list of files, opens each file, reads the contents, and then needs to output an excel file that contains the data plus additional notes that is determines from the data. The loop is something like this (overly simplified though)

Private Function ProcessFiles()

Dim FilesToProcess as List(Of String)

PopulateList(FilesToProcess)

For Each item As String in FilesToProcess

Dim fs As New FileStream(item)
Dim Data As String = fs.ReadToEnd

...
...
...

Next

End Function


In my program this is probably the function that takes the longest to complete and I feel that it might benefit from parallelization and would like to run some benchmarks. However I'm having trouble understanding how to implement the parallelization.

From what I've gathered so far I might be able to do something like this:

Private Function ProcessFiles()

Dim FilesToProcess as List(Of String)

PopulateList(FilesToProcess)

Parallel.ForEach(FilesToProcess ???)

Dim fs As New FileStream(item)
Dim Data As String = fs.ReadToEnd

...
...
...

Next

End Function


Not sure how to write the rest of the Parallel.ForEach. Any help would be greatly appreciated. Thanks in advance.
AnswerRe: Trying to Understand .NET 4 Parallelization Pin
Dave Kreskowiak1-Sep-10 7:34
mveDave Kreskowiak1-Sep-10 7:34 
GeneralRe: Trying to Understand .NET 4 Parallelization Pin
Dominick Marciano1-Sep-10 8:07
professionalDominick Marciano1-Sep-10 8:07 
AnswerRe: Trying to Understand .NET 4 Parallelization Pin
Luc Pattyn1-Sep-10 8:40
sitebuilderLuc Pattyn1-Sep-10 8:40 
GeneralRe: Trying to Understand .NET 4 Parallelization Pin
Dominick Marciano1-Sep-10 13:41
professionalDominick Marciano1-Sep-10 13:41 
GeneralRe: Trying to Understand .NET 4 Parallelization Pin
phil.o2-Sep-10 2:16
professionalphil.o2-Sep-10 2:16 
Questionbetter way to collect large amount of data from vb.net 2005 Pin
Andraw Tang1-Sep-10 3:30
Andraw Tang1-Sep-10 3:30 
AnswerRe: better way to collect large amount of data from vb.net 2005 Pin
Luc Pattyn1-Sep-10 3:42
sitebuilderLuc Pattyn1-Sep-10 3:42 
GeneralRe: better way to collect large amount of data from vb.net 2005 Pin
Andraw Tang1-Sep-10 3:48
Andraw Tang1-Sep-10 3:48 
GeneralRe: better way to collect large amount of data from vb.net 2005 Pin
David Mujica1-Sep-10 3:58
David Mujica1-Sep-10 3:58 
GeneralRe: better way to collect large amount of data from vb.net 2005 Pin
Andraw Tang1-Sep-10 4:01
Andraw Tang1-Sep-10 4:01 
GeneralRe: better way to collect large amount of data from vb.net 2005 Pin
Luc Pattyn1-Sep-10 4:02
sitebuilderLuc Pattyn1-Sep-10 4:02 
GeneralRe: better way to collect large amount of data from vb.net 2005 Pin
Andraw Tang1-Sep-10 4:05
Andraw Tang1-Sep-10 4:05 
QuestionHow to insert a resources.resx file into Excel? Pin
sanyexian29-Aug-10 15:10
sanyexian29-Aug-10 15:10 
AnswerRe: How to insert a resources.resx file into Excel? Pin
Dave Kreskowiak29-Aug-10 15:32
mveDave Kreskowiak29-Aug-10 15:32 
GeneralRe: How to insert a resources.resx file into Excel? Pin
sanyexian29-Aug-10 17:05
sanyexian29-Aug-10 17:05 
QuestionList Box Selection Pin
directred29-Aug-10 0:59
directred29-Aug-10 0:59 
AnswerRe: List Box Selection Pin
Eddy Vluggen29-Aug-10 3:40
professionalEddy Vluggen29-Aug-10 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.