add ray level multi-thread support. FIXME: the more threads, the less efficiency