How do you handle multi-threading and ensure thread safety when developing high-throughput backend services at Themesoft?