I basically have 3 Subs, I would like them to run together and converge once they finish and continue with the main sub. I can do this in C#, I am having difficulty managing to do this in VB.Net
Basically I am trying to accomplish something like the diagram below.
|---sub1()---|
Start sub()--------|---sub2()---|---main()----> end sub()
|---sub3()---|
Private Sub Manual_Trades_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim T1 As New Task(AddressOf sub1)
Dim T2 As New Task(AddressOf sub2)
Dim T3 As New Task(AddressOf sub3)
T1.Start()
T2.Start()
T3.Start()
Task.WaitAll(T1, T2, T3)
End Sub
Sub sub1()
'Do something that takes time
End Sub
Sub sub2()
'Do something that takes time
End Sub
Sub sub3()
'Do something that takes time
End Sub