single/multiple producer threads handled in templates