Tips on my multi-threading intuition? I wrote a program to copy a .doc template, add some text to it, then save and close it.  I have to do this many times, and saving and closing a word document is slow. I decided to use multi-threading, but I'm a noob at this stuff and just wrote what came to me. Any feedback would be greatly appreciated (on any aspect, not just the multi-threading).

Here is my code for a task:

public Task
{
    public string Value;
    public bool HasRun;
    public Task(string value)
    {
        Value = value;
        HasRun = false;
    }
}


I create a list of Tasks that is a class level variable, accessible by all threads:

Tasks = db.table.select(a =&gt; new Task(a.value)).ToList();


Next, I run the following in each thread:

while(tasks.Any(a =&gt; a.HasRun == false))
{
    var value = "";
    lock(tasks)
    {
        var task = tasks.Where(a =&gt; a.HasRun == false).First();
        value = task.Value;
        task.HasRun = true;   
    }

    CreateNewDocumentAppendValueAndSave(value);
}
Let the framework do multithreading for you:

List&lt;string&gt; tasks = new List&lt;string&gt;();
foreach (string value in db.table.select(a =&gt; a.value))
{
    tasks.Add(Task.Factory.StartNew(() =&gt; CreateNewDocumentAppendValueAndSave(value)));
}
Task.WaitAll(tasks.ToArray());


Where Task is System.Threading.Tasks.Task.