Construct synchronous or asynchronous thread executor