Multithreaded perimeter generation. #154