Implement new multi-threading API