Hi Benjamin, Thank you for reading it! As for Mutex and Arc they serve different purposes and complement each other. Arc is used for reference counting and making sure you can safely pass and access object from multiple threads/tasks, and Mutex makes sure only one can change it at a time by putting a lock on it.
But you're right, we could remove the Mutex in this situation as the Arc is all we need. Great spot! :)
Benjamin Eder
Hi there! Thanks for the tutorial. Pretty sure you do not need to use Mutex for sharing the MongoDB client instance between threads.
Comment from docs of
Client: