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

  • Home
  • SEARCH
  • 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 9025233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:13:19+00:00 2026-06-16T06:13:19+00:00

I would like to know how is the best way to implement my own

  • 0

I would like to know how is the best way to implement my own async method. I have read this article and it says that is not a good idea to wrapper a sync method into a task and use it as async method, because this way use other thread and use more resources, that is what we want to avoid with use async.

In the article use TaskCompletionSource, but I don’t know exactly how to use it. Which is the purpose of TaskCompletionSource?

  • 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-16T06:13:20+00:00Added an answer on June 16, 2026 at 6:13 am

    The best resource for writing async method is the Task-based Asynchronous Pattern (TAP) document by Stephen Toub. Much of the information in that document is now part of the official MSDN documentation.

    If you want a shorter (but still thorough) tutorial, I recommend my own async/await intro blog post, and there are several other tutorials out there. Once you have learned a bit about async, the next good resource is the official async/await FAQ.

    There are also tons of great async videos on Channel9. Many (most?) of them discuss async when it was still a CTP, but very few design changes were made when it went into production.

    To answer your specific question, TaskCompletionSource is used to create a Task wrapper around an existing asynchronous operation (e.g., an I/O operation, timer, or event). You can’t execute code in a Task created by TaskCompletionSource; you should use Task.Run to execute code in a Task.

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

Sidebar

Related Questions

I would like to know the best way to handle and implement session time
I would like to know the best way to implement paging in queries. Currently,
I would like know what is the best possible way to implement transactions with
I would like to know what's the best way to organize my php project
I would like to know What is the best way to include 3rd party
I would like to know how to use Queue in the best functional way.
I would like to know what is the best, fastest and easiest way to
I'm trying to find the best way to implement a QHash-like lookup table that
i would like to know what is the best option, im re-coding my own
I would like to know which is the best way to organize the dll

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.