Executing a method dynamically
<p>Many times i am using code like this:</p>

<pre><code>public static void ExecuteMethod1InThread(string msg)
{
    Thread t = new Thread(
        new ThreadStart(
            delegate
            {
                log(msg);
            }));
    t.IsBackground = true;
    t.Start();
    t.Join();
}
</code></pre>

<p>If you notice i am calling a method in a separate thread hoping it would be helpful in performance.</p>

<p>But I am wondering if it is possible to give the method name and parameters dynamically and have it execute it rather than creating blocks of code like above for every method call.</p>

<p>I know we could use reflection but it will affect the performance is my understanding.</p>

<p>I have also heard about anonymous delegates but i am not sure how they work.
Just wondering if anyone could enlighten.</p>
