Sub DoWork()
' Queue a task
System.Threading.ThreadPool.QueueUserWorkItem( _
New System.Threading.WaitCallback(AddressOf SomeLongTask))
' Queue another task
System.Threading.ThreadPool.QueueUserWorkItem( _
New System.Threading.WaitCallback(AddressOf AnotherLongTask))
End Sub
Sub SomeLongTask(ByVal state As Object)
' Insert code to perform a long task.
End Sub
Sub AnotherLongTask(ByVal state As Object)
' Insert code to perform another long task.
End Sub