Implement multi-threading calculation