What strategies do you use to ensure thread safety and handle concurrency in a multi-threaded application?