move pth code into hybirdthread