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 8197587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:46:21+00:00 2026-06-07T05:46:21+00:00

I have a class with event-based asynchronous operation(EAP). I can create a task based

  • 0

I have a class with event-based asynchronous operation(EAP). I can create a task based on it as it described here.

When I use EAP:

my thread -> calls method -> which creates thread -> in which it does something.

When I create task I suspect that:

my thread -> creates task -> which creates thread -> which calls method -> which creates thread -> in which it does something.

Is it true?

EDIT:

Offcourse task will not create a thread – it will take thread from the thread pool if needed. But will it be taken and will I have to spent valuable extra thread from the thread pool?

  • 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-07T05:46:24+00:00Added an answer on June 7, 2026 at 5:46 am

    To know exactly what’s going to happen, I would need to see your specific code, including how would you use the resulting Task.

    But in general, if you wrap EAP into a Task using TaskCompletionSource, it won’t use up another thread from the pool, because there is no code to be executed.

    If you mean what would happen if you used ContinueWith() on that Task, then that depends on whether you set TaskContinuationOptions.ExecuteSynchronously or not. If you don’t set it, the continuation will run on a “new” thread taken from the pool. If you do set it, it will run on the same thread that sets the result of the Task. (You should use ExecuteSynchronously only for very short continuations.)

    But whether the continuation will take a new thread from the pool or whether it uses a thread that was taken from the pool by someone else doesn’t matter much. What does matter is whether there will be any thread blocking until the operation completes. And in both cases, that’s not going to happen.

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

Sidebar

Related Questions

Ok, so I have a base class which declares the event StatusTextChanged . My
I have this code : class Event{}; class CustomEvent:public Event{}; class Handler { public:
I have following event class. I have a question related to the Property method
I have an Event class. Due to the way dates are handled, we need
I have a class with an event: public event MyEventHandler MyEvent; Is there any
I have defined an Event class: Event and all the following classes inherit from
I have a class essentially: public class WindowEvent extends Event { public static const
Say you have a class with an event property. If you instantiate this class
I have class A, which exposes an event. an object of class B subscribed
I'm trying to filter button events based on whether they have a CSS class

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.