Phase one of threaded batched writing
phase 2 of buffer coallation code
tune parameters