Click here to Skip to main content
15,846,342 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Is there any faster method other than Delegates to call more than one function at a time?
Updated 19-Sep-11 6:46am
#realJSOP 19-Sep-11 11:49am    
What does that mean?
Sergey Alexandrovich Kryukov 19-Sep-11 11:53am    
First, show you code with delegates and explain the requirements. Without it, this question does not sound like a sensible one.
Philippe Mori 19-Sep-11 21:20pm    
If your application process a lot of data by calling a lot of function, then I would suggest you to try alternatives and measure them to see how the performance is affected.

For general applications, then simply select the best design for your application.

1 solution

Delegates are pretty quick, so it's unlikely you'd need something faster. When you say calling more than one function at a time, do you mean chaining multiple methods together on a delegate to call sequentially? I presume so, unless you referring to the asynchronous programming model for multithreaded access.

An alternative is to define a method on an interface, get all 'subscribers' to implement this and then just iterate over a collection calling the method, but frankly I have no idea whether that would be quicker. I *think* that's the way Java does it.
Share this answer

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