Is the Amazon .NET AWS SDK's AmazonS3
thread safe or should I be creating a new instance of AmazonS3
per request in a multi-threaded system?
Specifically for the latest .NET AWS SDK (version 1.3.14).
Service clients in the SDK are thread-safe and, for best performance, you should treat them as long-lived objects.
My answer is YES you need to dispose it manually and I recommend keeping an instance of the object alive and re-using it for several operations just remember to dispose it when you are eventually done.
I also asked this question on the Amazon AWS forum and an official AWS employee replied (Norm@AWS) with:
The .NET SDK is thread safe so keeping an instance of any of the clients like AmazonS3 around and reusing them is fine.
Norm
Link (Amazon .NET Development Forum - Is the .NET SDK's AmazonS3 thread safe?).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With