Different variants of using thread class