added mainthread shutdown event.
fixed up mainthread communication problems.
added more benchmarks