Any example to use time slice and multi thread to do path find?

Hi, below is good video about path finding.How to get this in UNITY?how to use time slice and multi thread.Hope your help .thanks.

Blow is my test time slice, control one object A* is 4ms,but when control 20 pieces object A*,fps=2 …

        private const float STEPTIME =0.1f;
	IEnumerator SetAstarObj(Vector3 hp,Transform obj,int Num)
	{
		
		yield return new WaitForSeconds(STEPTIME*Num);
		setMouseClickAstar(hp,obj);
	}
	void Update()
	{
		//for new thread
		if(_grid==null)return ;

		if (InputManager.HITPOINT)
		{	
			Vector3 hp=InputManager.getMouseClickedPoint();
			Vector2 index=MoveAstarBase.transFormWorldPosToIndex(hp);
			if(index.x==OldIndex.x&index.y==OldIndex.y)//if index not changed ,no need update
			{}
			else
			{
				OldIndex=index;
				
				for(int i=1;i<obj.Length;++i)
				{
					Transform _player=obj[i];
					StartCoroutine(SetAstarObj(hp,_player,i));
			
				}
			}

		}
		
		for( int i=1;i<obj.Length;++i)
		{
			Transform _player=obj[i];
			MoveAstarBase asScript=_player.GetComponent<MoveAstarBase>();	
			if(asScript.move)
				{
					asScript.movePlayer(_player);
				}
		}
	}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Threading;


public class PusueAIGroup :MonoBehaviour {


	// Use this for initialization
	//public Transform objGroup;
	//public Transform target;
	public  Transform[] obj;
	
	private Vector2 OldIndex=new Vector2(0,0);
	private int indexObj=1;
	static private Grid _grid;
	private const float STEPTIME =0.1f;
	static public bool MOUSECLICKED=false;
	static private Vector3 HitPoint=new Vector3();
	private	ArrayList posG;
	
	static public Thread findPathThread;
	private List<MoveAstarBase> astarGroup;
	private int objNums;
	static private AutoResetEvent  aiWait=new AutoResetEvent (false);

	void Start()
	{
		
		objNums=obj.Length;
		astarGroup=new List<MoveAstarBase>(objNums);
		 posG=new ArrayList();
		for(int i=0;i<objNums;++i)
		{
			MoveAstarBase ms=new MoveAstarBase();
			astarGroup.Add(ms);
			posG.Add(obj[i].transform.position);
		}
	
	
 
		findPathThread=new Thread(new ThreadStart(testLoop));
		findPathThread.Start();
	}
	int hitN=0;
	void testLoop()
	{
		
		while(InputManager.mIsplaying)
		{
			
			if(aiWait.WaitOne())
				{
								
						hitN++;
						print("set:"+hitN);	
					lock (posG)
					for(int i=0;i<objNums;++i)
						{
							
						    Vector3 ps=(Vector3)posG[i];
							setMouseClickAstar(HitPoint,i,ps);
																
						}
				   //	aiWait.Close();
				
				}	
				
					
		}
		
	}
	static public void SetAIgrid (Grid grid ) {
		
		_grid=grid;
	
	}


	public void setMouseClickAstar(Vector3 clickedPoint,int PlayerId,Vector3 _playerPos)
	{	
		print("start check:");
		MoveAstarBase.CamMeshStartCord=PlayMoveAStar.CamMeshStartCord;
		MoveAstarBase._cellSize=PlayMoveAStar._cellSize;
		Vector2 index=MoveAstarBase.transFormWorldPosToIndex(clickedPoint);
		int ix=Mathf.FloorToInt(index.x);
		int iy=Mathf.FloorToInt(index.y);
		if(_grid.getNode(ix,iy).walkable==true)
		lock(astarGroup){
			astarGroup[PlayerId].SetUsingGrid(_grid);
			astarGroup[PlayerId].setEndNode(ix,iy);
			astarGroup[PlayerId].setStartNodeByPlayerPos(_playerPos);
			bool at=astarGroup[PlayerId].findPath();
			print("find:"+at);
		}
			
	
	}

	void Update()
	{
		//for new thread
		if(_grid==null)return ;

		if (InputManager.HITPOINT)//mouse click on the map
		{	
			Vector3 hp=InputManager.getMouseClickedPoint();
			Vector2 index=MoveAstarBase.transFormWorldPosToIndex(hp);
			if(index.x==OldIndex.x&index.y==OldIndex.y)//if index not changed ,no need update
			{}
			else
			{
				OldIndex=index;
				 posG=new ArrayList();
				for(int i=0;i<objNums;++i)// update the objects position,then update astar in aiThread
				{
					posG.Add(obj[i].transform.position);
				};
				HitPoint=InputManager.getMouseClickedPoint();
				aiWait.Set();
			    
			}
		}
		
		
		for( int i=0;i<objNums;++i)// if found the path,moving the object in mainThread
			{
				Transform _player=obj[i];
				MoveAstarBase asScript=astarGroup[i];	
				if(asScript.move)
					{
						asScript.movePlayer(_player);
					}
			}
			
		
	}
}

I want to make this:click the mouse ,calculate the position of the objects in main thread,then give the position to aiThread,when aiThread finish pathfind,then give the path to main thread,and move the object.But these code not work,when i click the mouse more times, then unity crash…Need your help,Thanks in advanced~