O
old_School
Guest
I want to run multi threads for multi functions. I need to wait until all the threads have finished before I contenue but I want to run them parel to each other. For Example
Thread A - Main Thread
Thread B - Second Thread - Returns Data Table
Thread C - Third Thread - Returns Data Table
Thread D - Fourth Thread - Returns Data Table
I want to run threads a, b, c and d at the same time. Then I need to wait for threads b, c and d to complete. I'm a little newb to Async Await. If I use Async AWait can it run b,c, and d at the same time and wait until all three have finished? Anyone have a simple sample or code snippet?
Call to Function
Data_dt = New Task(Async_LoadSummaryData("Order", sFacility))
Currently gives errors and I dont know whats wrong
Function:
Async Function Async_LoadSummaryData(ByVal StatusType As String, ByVal Filter As String, Optional ByVal Station As String = "", Optional ByVal AttrValue As String = "", Optional ByVal AttrValue2 As String = "", Optional ByVal AttrValue3 As String = "") As Task(Of DataTable)
Dim dt As DataTable = New DataTable()
dt = LoadSummaryData(StatusType, Filter, Station, AttrValue, AttrValue2, AttrValue3)
Return dt
End Function
Continue reading...
Thread A - Main Thread
Thread B - Second Thread - Returns Data Table
Thread C - Third Thread - Returns Data Table
Thread D - Fourth Thread - Returns Data Table
I want to run threads a, b, c and d at the same time. Then I need to wait for threads b, c and d to complete. I'm a little newb to Async Await. If I use Async AWait can it run b,c, and d at the same time and wait until all three have finished? Anyone have a simple sample or code snippet?
Call to Function
Data_dt = New Task(Async_LoadSummaryData("Order", sFacility))
Currently gives errors and I dont know whats wrong
Function:
Async Function Async_LoadSummaryData(ByVal StatusType As String, ByVal Filter As String, Optional ByVal Station As String = "", Optional ByVal AttrValue As String = "", Optional ByVal AttrValue2 As String = "", Optional ByVal AttrValue3 As String = "") As Task(Of DataTable)
Dim dt As DataTable = New DataTable()
dt = LoadSummaryData(StatusType, Filter, Station, AttrValue, AttrValue2, AttrValue3)
Return dt
End Function
Continue reading...