1

I have a MVC4 Application which waits for a third party subsystem. Each request takes 2 to 5 Seconds. The communication is done via WCF and i use NET 4.5.

Currently i wait synchronous to the answer and show then results. All sql queries after the result is received cannot be moved in between the async and await, as they are depended on the result.

Does it make sense anyway to apply the AsyncAwait pattern?

Does it reduce the amount of threads inside the IIS?

Sample:

client2 = new ServiceReference2.Service1Client(); string res = await client2.GetHello2Async(); 
3
  • 1
    Yes, it does make sense. Commented Jun 10, 2013 at 8:26
  • 1
    Example of proxy can be viewed in guruumeditation.net/async-await-with-wcf Commented Jul 27, 2013 at 6:25
  • thx. i know. my question was less how, more if it makes sense if i do nothing between the request is running. Commented Jul 27, 2013 at 7:43

1 Answer 1

1

Yes, switching to async-await is going to decrease the number of ThreadPool threads used by your code. That's the primary reason for using async-await in server-side applications.

Sign up to request clarification or add additional context in comments.

1 Comment

@PauloMorgado Your suggested edit is wrong. There is no special “request handling thread pool”, in ASP.NET, there is just the single ThreadPool.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.