Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9030967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:37:10+00:00 2026-06-16T07:37:10+00:00

IHttpAsyncHandler means run the request asynchronously. Using the thread pool also can run asynchronously.

  • 0

IHttpAsyncHandler means run the request asynchronously.

Using the thread pool also can run asynchronously.

So if I want to implement a function (like Comet,long poll), between using thread pool with IHttpHandler and using IHttpAsyncHandler, which is better?

EDIT:
@Jon Skeet:
Thank you for your patient reply. Let me make a conclusion. If I use delegate.BeginInvoke in the IHttpHandler,the ‘Main Thread’ of processing request still keeps spinning until the request end,no matter what happened with the pooled thread. If I use the IHttpAsyncHandler, the ‘Main Thread’ of processing request will call the BeginProcessRequest and after that,it will be released (to process other request). The BeginProcessRequest method will do something asynchronously. When the asynchronous action finished,the EndProcessRequest method will be called.(or we can say the ‘Main Thread’ will call the EndProcessRequest function to finished current request)

All above are what I think, is it right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:37:12+00:00Added an answer on June 16, 2026 at 7:37 am

    The difference is that with a truly asynchronous model, you don’t need a thread per request at all. If you have a thread per request, whether or not it’s on the thread pool, you’ll be stuck handling a large number of connections (as you need to for things like long polling).

    Suppose you have a hundred thousand clients, each long-polling – do you really want 100,000 threads? (Hint: I doubt that you’ve got enough memory…)

    With genuine asynchrony, you can react to events by ending a request without having a dedicated thread per request. Note that with C# 5 and .NET 4.5, there are simpler ways than using IHttpAsyncHandler, too. It depends on what you’re trying to achieve, but both WCF and MVC have async-oriented approaches where you can write an async method, using await expressions etc. If you then await something which doesn’t in itself take a thread (e.g. a timer, or perhaps some IO completing) then you can manage a huge number of concurrent connections.

    EDIT: To respond to your further questions: yes, if you use just IHttpHandler, the request must be completed when the ProcessRequest call completes. You can’t just leave it “dangling”… whereas IHttpAsyncHandler allows the request to still be in progress until EndProcessRequest is called. Don’t forget that this is a very old interface though – it’s not terribly clearly documented, and I wouldn’t suggest using it these days, when there are significantly better approaches to asynchrony, particularly using .NET 4.5 and C# 5. But the main point of being able to have a request in progress but without any specific thread being associated with it still holds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an IHttpAsyncHandler that I'm trying to call using AJAX, with jQuery.
I have implemented an IHttpAsyncHandler. I am making about 5 different AJAX calls from
I have noticed that the .NET IHttpAsyncHandler (and the IHttpHandler, to a lesser degree)
When ever my project is run in debug mode on a local machine, I
When I run Silverlight unit tests, I get First Chance HttpException, at the following
I am using ASP.NET membership, and in particular a copy of the membership code
I implemented a System.Web.IHttpAsyncHandler to limit website bandwidth usage for files download. Once defined
I saw this aricle which describes implementing the IHttpAsyncHandler . Looking at this part:
We are streaming video from a ashx implementing IHttpAsyncHandler to our Silverlight client. On
I'm looking at implementing IHttpAsyncHandler in an application and am not sure if it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.