优化thread session