If you're using 4.0+ .NET version, this would be shortest way I think:
Task.Factory.StartNew(() =>
{
myObject1.myFunction(10, "Test");
myObject2.myFunction(20, "Test");
myObject3.myFunction(30, "Test");
})
More: http://msdn.microsoft.com/en-us/library/dd321439.aspx
Jeroen offered to use Thread.Start for this task, which is little bit shorter, but according to Skeet you loose these things, when you use plain Thread over Task:
The task gives you all the goodness of the task API:
- Adding continuations (Task.ContinueWith)
- Waiting for multiple tasks to complete (either all or any)
- Capturing errors in the task and interrogating them later
- Capturing cancellation (and allowing you to specify cancellation to start with)
- Potentially having a return value
- Using await in C# 5
- Better control over scheduling (if it's going to be long-running, say so when you create
the task so the task scheduler can take that into account)