first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

C# Code Snippet: Simple Threading

/* This example does not take into account Thread() being called in sucession as ThreadTarget() is running. It does not deal with data being passed to/from ThreadTarget() as well. */ using System.Threading;

private void Thread()
{
    ThreadStart myThreadDelegate = new ThreadStart(this.ThreadTarget);
    Thread myThread = new Thread(myThreadDelegate);
    myThread.Priority = ThreadPriority.AboveNormal;
    myThread.Start();
}

private void ThreadTarget()
{
    //Perform task on thread.
}
mod date: 2004-06-19T18:39:39.000Z