O
OpticTygre
I have a class, ProcessFiles, with several subroutines it runs for each type
of file I want to "process."
First, I check directories for files. Then, based on the filenames of those
I find in the directory, I do IP address lookups from a database to see
where these files need to be sent. After I lookup the IP addresses, I
dimension a new class (ProcessThreads), and call ProcessThreads.Process for
each IP I pull out of the database. In psuedo code it looks like:
Private Sub ProcessUsers()
For each filename in FileList
Open database connection, and retrieve a list of IP's
Do while rs.read()
Add IP address to an array
Loop
If IPArray(0) <> "" Then
Dim ProcessThreads as New ProcessThreads
ProcessThreads.Process(FileName, IPArray)
End If
Next
End Sub
In ProcessThreads, it adds an instance of a new class to a threadpool, which
actually does the transfer of files, etc... ProcessThreads also keeps track
of the threads it calls, via some sample code I found elsewhere.
However, I'm curious about the above code. Each time I call ProcessThreads,
will this part of the program stall until that instance of the
ProcessThreads.Process routine finishes, or will this actually do what I
want it to, and call several instances of ProcessThreads at once (or right
in a row, really)?
-Jason
of file I want to "process."
First, I check directories for files. Then, based on the filenames of those
I find in the directory, I do IP address lookups from a database to see
where these files need to be sent. After I lookup the IP addresses, I
dimension a new class (ProcessThreads), and call ProcessThreads.Process for
each IP I pull out of the database. In psuedo code it looks like:
Private Sub ProcessUsers()
For each filename in FileList
Open database connection, and retrieve a list of IP's
Do while rs.read()
Add IP address to an array
Loop
If IPArray(0) <> "" Then
Dim ProcessThreads as New ProcessThreads
ProcessThreads.Process(FileName, IPArray)
End If
Next
End Sub
In ProcessThreads, it adds an instance of a new class to a threadpool, which
actually does the transfer of files, etc... ProcessThreads also keeps track
of the threads it calls, via some sample code I found elsewhere.
However, I'm curious about the above code. Each time I call ProcessThreads,
will this part of the program stall until that instance of the
ProcessThreads.Process routine finishes, or will this actually do what I
want it to, and call several instances of ProcessThreads at once (or right
in a row, really)?
-Jason