added generalized thread support for scotch