threadstest: functions templetized