How do you handle concurrency in a multi-threaded environment, and what are the risks of race conditions?