Click here to Skip to main content
15,917,793 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear friends,

I have created function with arguments. Parameter values may be change every call and return Dataset. Usually if we call in sequentially manner but it will take some time for each block execution. Hence, I move to TPL.

Please go through below example, I have called four times in Parallel. Invoke method. Its working fine and also I got result as Dataset. My problem was, I have called function 4 times only but I want to call any number of times.

So please provide sample.

Example :
VB
Parallel.Invoke(Function() As DataSet
 DT1 = GETDS("TEST 1", a) 
 Return DT 
End Function,
Function() As DataSet
 DT2 = GETDS("TEST 2", b)
 Return DT
End Function,
Function() As DataSet
  DT3 = GETDS("TEST 3", c)
  Return DT
End Function,
Function() As DataSet
  DT4 = GETDS("TEST 4", b)
  Return DT
End Function)
Posted
Updated 8-Dec-11 20:06pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900