Q:

How to call threads before other threads?

I'm new to threading and don't quite understand the structuring of it.
class Program
{
    static void Main(string[] args)
    {
        Console.Read();
    }

    static void Gone()
    {
        for (int i = 0; i < 5; i++)
        {

            Console.WriteLine("Gone");
        }
    }

    static void Going()
    {
        for (int i = 0; i < 2; i++)
        {       
            Console.WriteLine("Going");
        }
    }
}
}

I am trying to alter the above code so that the main thread creates a thread calling the Gone method. Also, I want to alter the Gone method so it creates a thread to hit Going before it prints gone. I'm assuming a Join would be used in the latter of my problem but I don't know where to put threads or where to use a join ( I had the following code within the Main method but that only displayed the word "Gone" 5 times and not "Going".
Thread t = new Thread(Gone);
        t.Start();
        t.Join();

A:

I am not sure if I understand correctly but this is what I would do:
class Program
{
    static void Main(string[] args)
    {
        Thread thread2 = new Thread(new ThreadStart(Gone));

        thread2.Start();

        Console.Read();
    }

    static void Gone()
    {
        for (int i = 0; i < 5; i++)
        {

            Thread thread1 = new Thread(new ThreadStart(Going));
            thread1.Start();
            thread1.Join();
            Console.WriteLine("Gone");
        }
    }
    static void Going()
    {
        for (int i = 0; i < 2; i++)
        {       
            Console.WriteLine("Going");
        }
    }

Output:

Going
Going
Gone
Going
Going
Gone
Going
Going
Gone
Going
Going
Gone
Going
Going
Gone

This will run synchronously.

