Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

Deadlock issue when making multiple calls in WCF

 
 
Thread Tools Display Modes
Old 11-03-2007   #1 (permalink)
Jason Rodman
Guest


 

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?
Old 11-07-2007   #2 (permalink)
Joe-P
Guest


 

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?
Old 11-07-2007   #3 (permalink)
Jason Rodman
Guest


 

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?
Old 11-08-2007   #4 (permalink)
Joe-P
Guest


 

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?
Old 12-01-2007   #5 (permalink)
MobileMan
Guest


 

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?
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
error making Video calls Atlantan Live Messenger 0 04-06-2008 10:45 PM
Help! Reached a deadlock Yakor Vista security 0 09-30-2007 07:24 PM
How does Vista make making telephone calls any easier ?? Synapse Syndrome Vista General 0 01-30-2007 11:48 AM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50