Is WCF ClientBase thread safe?

multithreading, wcf

Solution

Yes, it is thread-safe. However, you should know that WCF will automatically serialize the execution of `CalculateSomething` when it is called from more than one thread using the same `ClientBase` instance. So if you were expecting `CalculateSomething` to run concurrently then you will have to rethink your design. Take a look at this answer for one approach to creating an asynchronous API for the `CalculateSomething` method.

Problem

I have implemented ClientBase to use WCF to connect to a service. I'm then calling a method on the channel to communicate with the service. ``` base.Channel.CalculateSomething(); ``` Is this call thread safe or should I lock around it when running multiple threads? Thanks

Original source

Related problems