I like to call the method in thread with arguments and return some value here example
class Program
{
static void Main()
{
Thread FirstThread
There is much simpler way to execute function in separate thread:
// Create function delegate (it can be any delegate)
var FunFunc = new Func(fun1);
// Start executing function on thread pool with parameters
IAsyncResult FunFuncResult = FunFunc.BeginInvoke(1, 5, null, null);
// Do some stuff
// Wait for asynchronous call completion and get result
int Result = FunFunc.EndInvoke(FunFuncResult);
This function will be executed on thread pool thread, and that logic is completely transparent to your application. An in general, I suggest to execute such small tasks on thread pool instead of dedicated thread.