Currently I have the code that is called from a Task that is causing performance issues.  

var jsBoardInfo = Board.ConvertToJS((Board)pathItem);
Tuple<Board, CurrentPiece> returnItem = (Tuple<Board, CurrentPiece>)realInfo.form.Invoke(
    new Func<object, Tuple<Board, CurrentPiece>>((jsBoardObj) =>
        var jsBoard = (int[])jsBoardObj;
        var newBoard = javaScriptCon.getBoard();
        var newPiece = javaScriptCon.getCurrentPeice();
        return new Tuple<Board, CurrentPiece>(newBoard, newPiece);
        }), jsBoardInfo);


What javaScriptCon is doing is using an the HTMLDocument.InvokeScript function to make calls to javascript functions.   However it's causing the program to to be unresponsive, and I'm looking for an alternative solution, that does not require