How do you implement thread-safe operations without relying on heavy locking mechanisms like the lock statement in C#?