It's not safety for thread.

Mar 11, 2010 at 6:36 PM

Dear EveryOne.

i have modified a sample code to test MAF Performance Code.

i have appended a little to AddIn Class to create a thread, and forces a exception.

i excuted the code, the child process occcured a exception because of thread.

All of processes(Host, and child) has dead.i think it isn't isolation.

how can i solve this problem to isolate a process

private Thread _trMerge = null;
        public MyAddIn()
        {
            ThreadStart ts = new ThreadStart(Tr);
                _trMerge = new Thread(ts);
                _trMerge.Start();
        }
        private List<int> _list = new List<int>();
        public void Tr()
        {
            Console.WriteLine("=================== Start ===========");
            int i = _list[0];
            Console.WriteLine("===================End ===========");
        }
        public void DoStuff()
        {
            if (_trMerge == null)
            {
                Console.WriteLine("===================Start ===========");
                ThreadStart ts = new ThreadStart(LogFileMergeTh);
                _trMerge = new Thread(ts);
                _trMerge.Start();
            }
        }