thread safety for messageSorter, stress test in messagesortertest