![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Deadlock issue when making multiple calls in WCF I have a scenario where I use a self-hosted service that uses NetTcpDuplexBinding. If my client app attempts to make a call to the service while a callback is coming in from the service, i get a deadlock issue. I thought that defining my service with ConcurrencyMode=Multiple would allow this, but its just not working that way. Here is the exact message I am getting: System.InvalidOperationException: This operation would deadlock because the reply cannot be received until the current Message completes processing. If you want to allow out-of-order message processing, specify ConcurrencyMode of Reentrant or Multiple on CallbackBehaviorAttribute. I also have a need to be able to make one call from the client while another is in progress, but I get this same issue. What can I do to allow this type of behavior? |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Deadlock issue when making multiple calls in WCF Hi Jason, Did you try ConcurrencyMode=Rentrant instead of Multiple on the client side? Since that seems to be the attribute needed in your situation. "Jason Rodman" wrote: Quote: > I have a scenario where I use a self-hosted service that uses > NetTcpDuplexBinding. If my client app attempts to make a call to the service > while a callback is coming in from the service, i get a deadlock issue. I > thought that defining my service with ConcurrencyMode=Multiple would allow > this, but its just not working that way. Here is the exact message I am > getting: > > System.InvalidOperationException: This operation would deadlock because the > reply cannot be received until the current Message completes processing. If > you want to allow out-of-order message processing, specify ConcurrencyMode of > Reentrant or Multiple on CallbackBehaviorAttribute. > > I also have a need to be able to make one call from the client while another > is in progress, but I get this same issue. What can I do to allow this type > of behavior? |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Deadlock issue when making multiple calls in WCF Thanks for your reply Joe. From what I read about that mode, the service runs in single threaded mode, which wont work for my scenario. I need to be able to handle hundreds of concurrently connected users to the same service and be able to service their requests in parallell. If i change this, the service can only service one request at a time from what it sounds like. Am I understanding this right? "Joe-P" wrote: Quote: > Hi Jason, > Did you try ConcurrencyMode=Rentrant instead of Multiple on > the client side? Since that seems to be the attribute needed in your > situation. > > > "Jason Rodman" wrote: > Quote: > > I have a scenario where I use a self-hosted service that uses > > NetTcpDuplexBinding. If my client app attempts to make a call to the service > > while a callback is coming in from the service, i get a deadlock issue. I > > thought that defining my service with ConcurrencyMode=Multiple would allow > > this, but its just not working that way. Here is the exact message I am > > getting: > > > > System.InvalidOperationException: This operation would deadlock because the > > reply cannot be received until the current Message completes processing. If > > you want to allow out-of-order message processing, specify ConcurrencyMode of > > Reentrant or Multiple on CallbackBehaviorAttribute. > > > > I also have a need to be able to make one call from the client while another > > is in progress, but I get this same issue. What can I do to allow this type > > of behavior? |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Deadlock issue when making multiple calls in WCF Hi Jason, Yeah you are right. Looks like you may want to use Asynchronous mechanism. My recommendation would be to create the Asynchronus mechanism on the service side therefore when the client makes the call it would seem its a synchronous call. This way you are technically putting the message into a queue depending on how many threads are available in the thread pool. If there are enough available then the operation would be similar to regular synchronus operation. Again, depending on your architecture you can have the client initiating or service initiating the asynchronous call but this is an option to prevent deadlock condition. To do it its easy and very little coding on your part. "Jason Rodman" wrote: Quote: > Thanks for your reply Joe. From what I read about that mode, the service runs > in single threaded mode, which wont work for my scenario. I need to be able > to handle hundreds of concurrently connected users to the same service and be > able to service their requests in parallell. If i change this, the service > can only service one request at a time from what it sounds like. Am I > understanding this right? > > "Joe-P" wrote: > Quote: > > Hi Jason, > > Did you try ConcurrencyMode=Rentrant instead of Multiple on > > the client side? Since that seems to be the attribute needed in your > > situation. > > > > > > "Jason Rodman" wrote: > > Quote: > > > I have a scenario where I use a self-hosted service that uses > > > NetTcpDuplexBinding. If my client app attempts to make a call to the service > > > while a callback is coming in from the service, i get a deadlock issue. I > > > thought that defining my service with ConcurrencyMode=Multiple would allow > > > this, but its just not working that way. Here is the exact message I am > > > getting: > > > > > > System.InvalidOperationException: This operation would deadlock because the > > > reply cannot be received until the current Message completes processing. If > > > you want to allow out-of-order message processing, specify ConcurrencyMode of > > > Reentrant or Multiple on CallbackBehaviorAttribute. > > > > > > I also have a need to be able to make one call from the client while another > > > is in progress, but I get this same issue. What can I do to allow this type > > > of behavior? |
My System Specs![]() |
| | #5 (permalink) |
| | RE: Deadlock issue when making multiple calls in WCF Joes & Jason: What about changing the InstanceMode to "PerCall" instead of using the default? Would this take care of this issue? -- Stay Mobile "Joe-P" wrote: Quote: > Hi Jason, > Yeah you are right. Looks like you may want to use Asynchronous > mechanism. My recommendation would be to create the Asynchronus mechanism on > the service side therefore when the client makes the call it would seem its a > synchronous call. This way you are technically putting the message into a > queue depending on how many threads are available in the thread pool. If > there are enough available then the operation would be similar to regular > synchronus operation. Again, depending on your architecture you can have the > client initiating or service initiating the asynchronous call but this is an > option to prevent deadlock condition. To do it its easy and very little > coding on your part. > > "Jason Rodman" wrote: > Quote: > > Thanks for your reply Joe. From what I read about that mode, the service runs > > in single threaded mode, which wont work for my scenario. I need to be able > > to handle hundreds of concurrently connected users to the same service and be > > able to service their requests in parallell. If i change this, the service > > can only service one request at a time from what it sounds like. Am I > > understanding this right? > > > > "Joe-P" wrote: > > Quote: > > > Hi Jason, > > > Did you try ConcurrencyMode=Rentrant instead of Multiple on > > > the client side? Since that seems to be the attribute needed in your > > > situation. > > > > > > > > > "Jason Rodman" wrote: > > > > > > > I have a scenario where I use a self-hosted service that uses > > > > NetTcpDuplexBinding. If my client app attempts to make a call to the service > > > > while a callback is coming in from the service, i get a deadlock issue. I > > > > thought that defining my service with ConcurrencyMode=Multiple would allow > > > > this, but its just not working that way. Here is the exact message I am > > > > getting: > > > > > > > > System.InvalidOperationException: This operation would deadlock because the > > > > reply cannot be received until the current Message completes processing. If > > > > you want to allow out-of-order message processing, specify ConcurrencyMode of > > > > Reentrant or Multiple on CallbackBehaviorAttribute. > > > > > > > > I also have a need to be able to make one call from the client while another > > > > is in progress, but I get this same issue. What can I do to allow this type > > > > of behavior? |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| error making Video calls | Live Messenger | |||
| Help! Reached a deadlock | Vista security | |||
| How does Vista make making telephone calls any easier ?? | Vista General | |||