Thread-Safe Shared State
To share state across threads, you need Arc (Atomically Reference Counted) and Mutex (Mutual Exclusion).
Arc: Allows multiple threads to own the pointer.Mutex: Ensures only one thread can access the data at a time.
rust let counter = Arc::new(Mutex::new(0));