minor change to thread for path thread to try_lock
added intel tbb support

Refactored to use intell tbb's flow graph feature. Improved performance.