I'm trying to add some values to an ArrayList in one thread and remove from another thread without using any lock or mutex. While removing an `IndexOutOfRangeException` is thrown and removeThread should stop there only, but it doens't! Why?`

Please look at following code:

```
class Program
{
    static ArrayList alist = new ArrayList();

    static void Main(string[] args)
    {
        Program p = new Program();
        Thread removeThread = new Thread(p.StartRemoval);
        Thread addThread = new Thread(p.StartAddition);
        addThread.Start();
        removeThread.Start();

        addThread .Join();
        removeThread.Join();

        //Console.ReadKey();
    }

    void StartRemoval()
    {
        for (int i = 0; i < 100000; i++)
            alist.Remove(i); // Exception
    }

    void StartAddition()
    {
        for (int i = 0; i < 100000; i++)
            alist.Add(i); 
    }
}

```

Even after exception in `removeThread`, it executes for remaining iterations. Can you please explain why?

Stack Trace:

`at System.Collections.ArrayList.RemoveAt(Int32 index)
 at ConsoleApplication2.Program.StartRemoval() in Program.cs:line 34
 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
 at System.Threading.ThreadHelper.ThreadStart()`

in following scenerio, i'm getting above stack trace

1. put breakpoint to last curly brace of all the methods. (main, StartAddition, StartRemoval)
2. Start debugging.
3. StartRemoval executes the last line even after exception.

If you run it without debugging it's working as expected and correctly. But the stack trace is same. `Remove` is called in code but `RemoveAt` is traced in trace report.

Thanks.