base for multithreaded training