trying to track down a segfault that happens with 1000+ threads, pre-allocated some heavily-used variables for possible speed improvement, other stuff