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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:49:56+00:00 2026-05-14T16:49:56+00:00

I have an application which has a loop, part of a Scheduler, which runs

  • 0

I have an application which has a loop, part of a “Scheduler”, which runs at all time and is the heart of the application. Pretty much like a game loop, just that my application is a WPF application and it’s not a game. Naturally the application does logging at many points, but the Scheduler does some sensitive monitoring, and sometimes it’s impossible just from the logs to tell what may have gotten wrong (and by wrong I don’t mean exceptions) or the current status.

Because Scheduler’s inner loop runs at short intervals, you can’t do file I/O-based logging (or using the Event Viewer) in there. First, you need to watch it in real-time, and secondly the log file would grow in size very fast. So I was thinking of ways to show this data to the user in the realtime, some things I considered:

  • Display the data in realtime in the UI
  • Use AllocConsole/WriteConsole to display this information in a console
  • Use a different console application which would display this information, communicate between the Scheduler and the console app using pipes or other IPC techniques
  • Use Windows’ Performance Monitor and somehow feed it with this information
  • ETW

Displaying in the UI would have its issues. First it doesn’t integrate with the UI I had in mind for my application, and I don’t want to complicate the UI just for this. This diagnostics would only happen rarely. Secondly, there is going to be some non-trivial data protection, as the Scheduler has it’s own thread.

A separate console window would work probably, but I’m still worried if it’s not too much threshold. Allocating my own console, as this is a windows app, would probably be better than a different console application (3), as I don’t need to worry about IPC communication, and non-blocking communication. However a user could close the console I allocated, and it would be problematic in that case. With a separate process you don’t have to worry about it.

Assuming there is an API for Performance Monitor, it wouldn’t be integrated too well with my app or apparent to the users. Using ETW also doesn’t solve anything, just a random idea, I still need to display this information somehow.

What others think, would there be other ways I missed?

  • 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-05-14T16:49:57+00:00Added an answer on May 14, 2026 at 4:49 pm

    Respectfully – both Adrian K and Dima’s answers are not correct. The right answer is to use Event Tracing For Windows (ETW). This is what we use for all logging in Windows. Its extremely robust and very well performing. For example W7 logs an ETW event on many OS events – all the time – including processor context switch. Ever use the performance monitor in W7? It is consuming ETW events from the kernel.

    I recommend you do all your logging with ETW. Why? Several reasons:

    1. Its ubiquitous
    2. You can enable disable logging in your running process. No process restarts required. (yes, other loggers do this, but some do not).
    3. Its designed for including in shipping code.
    4. Logging an event is guaranteed to be non-blocking: it will not cause a ‘wait’.
    5. We provide lots of tools for ETW trace processing. most notably the XPERF tools (link, link, link)

    A big benefit of instrumenting your performance paths with ETW events is that your events can be seen integral with the kernel events using the XPERF tools.

    Its also pretty easy to write a ‘watch’ application that watches ETW events from your components. I have one for one of our components that simply displays the events to the console.

    I highly recommended to not try and write your own high performance logging system. This is challenging to do well, but in terms of performance and reliability. The Windows ETW system is super-robust and very well performing.

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

Sidebar

Related Questions

We have a Flex application which has several 'pages' worth of content. Each time
I have an network application which uses a select loop like this: bool shutdown=false;
I have an application which has a similar interface to Visual Studio, in that
I have an application which has a Projects table and a Users table. In
We have an application which has about 15000 pages. For better SEO reasons we
I have an MVC application which has a set of fields for contact details
I have an iphone application which has about 4 tabs. How do I force
I have a Windows application which has a browser in it. The Windows application
I have a Java Application which has to load an DLL with a few
I have a console application which has target .NET 2.0 It is very short

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.