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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:38:23+00:00 2026-06-10T11:38:23+00:00

I have a class that fires an event at a fairly rapid frequency (every

  • 0

I have a class that fires an event at a fairly rapid frequency (every 100ms). To avoid slowing down this process, event handlers should hand off the processing to some kind of background task/thread/worker (as opposed to doing it within the event handler).

What’s the best approach? Should I use Task.Factory.StartNew within the event handler? Will there be an overhead of creating tasks this rapidly (e.g. 5 event handlers will create 5 tasks every 100ms)? Or could I use a BackgroundWorker (instantiated in a subscriber’s constructor), and in the event handler call the .RunAsync method?

  • 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-10T11:38:25+00:00Added an answer on June 10, 2026 at 11:38 am

    Two ways:

    • Either use Task.Factory.StartNew. This method relies on the ThreadPool to minimize the task creation cost. This should be ok in most cases.
    • If you need to further reduce the performance impact, you can create a producer/consumer queue. When the event is triggered, enqueue a notification. On the other side, a thread monitors the queue and process the notifications as they arrive.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My markup: <ul id=playerControls> <li class=play-bt></li> </ul> And I have this event that fires
I have class that looks like this: class A { public: class variables_map vm
How do I create a new event in a base page class that fires
I have an application that fires 2 threads, the 1st launches another class to
I have a class that manages keyboard input and fires off KeyPressed , KeyReleased
I have a c# app (Windows Service) that fires a timer event that reads
I have a class that fires events delegating to DispatcherObject targets which is marshalling
I have an asynchronously running Task that fires an event when it's completed like
I have a 3 dropdownlist control with a selectedindexchanged event that fires correctly. However,
Delphi part: I have a class with the event and from that event I

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.