Namespace res to thread

Namespace res to thread