If automatic synchronization is activated with ConcurrencyMode.Single, a service instance is locked by WCF when it is asked to perform an operation. This prohibits other worker threads to enter this service instance, and thus provides thread-safety to the service's code by serializing the client requests.
Automatic synchronization works for service instances because the only threads to access them are WCF's worker threads, and these are disciplined to set the lock as required. Unluckily, this might not work for the client callback objects, because they can also be accessed by non-WCF threads being unaware of this locking scheme.
As a rule, callback objects cannot solely rely on WCF automatic synchronization for their thread-safety, and need to provide their own manual synchronization.
Sunday, August 17, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment