Hello folks. I've got an odd situation here. I need to pass a variable to a sub that I want to make into a new thread. My current conundrum is as follows:
Dim Mults(127) as Threading.Thread
Dim n As Integer
For n = 0 to 127
Mults
= New Threading.Thread(AddressOf SomeSub
)
Next
If I do it that way, it says that I can't have the
. If I do this this way:
Dim Mults(127) as Threading.Thread
Dim n As Integer
For n = 0 to 127
Mults
= New Threading.Thread(AddressOf SomeSub)
Next
It of course doesn't match my sub's params. I need to pass a variable to the sub in order to be useful. It wouldn't be such a big deal, but the sub can take up to 2 seconds waiting for a response, so I want to make each a new thread and just wait a single 2 seconds instead of 127 * 2 seconds.
How can I pass the variable to the sub/function of the new thread?
Dim Mults(127) as Threading.Thread
Dim n As Integer
For n = 0 to 127
Mults
Next
If I do it that way, it says that I can't have the
Dim Mults(127) as Threading.Thread
Dim n As Integer
For n = 0 to 127
Mults
Next
It of course doesn't match my sub's params. I need to pass a variable to the sub in order to be useful. It wouldn't be such a big deal, but the sub can take up to 2 seconds waiting for a response, so I want to make each a new thread and just wait a single 2 seconds instead of 127 * 2 seconds.
How can I pass the variable to the sub/function of the new thread?