ETW log files are great for post-mortem debugging and analysis. But did you know that you can actually process ETW event streams in (near) real-time without log files at all? It’s true! Real-time event consumption has historically been accessible only…
Using PLA.dll to collect ETW traces
As demonstrated previously, PLA.dll allows you to collect perf counter logs. It can also be used to collect ETW traces. To collect traces, you need to add one or more trace data providers to your collector. Trace data providers are…
Threads don’t scale
Async aficionados should know by now that I/O-bound workloads based on dedicated threads simply do not scale past a certain limit. Typically, when you start creating more threads than you have logical CPU cores, you will suffer ever-increasing overhead due…
Using PLA.dll to collect perf counters
Who doesn’t love diagnostics?! I am a big proponent of efficient and well thought out tracing and performance counters. They are invaluable for debugging, performance testing, health monitoring, and many other tasks worthy of future blog posts. Seasoned Windows professionals…
Alternatives to DisposeAsync
It stands to reason that DisposeAsync would be the asynchronous counterpart of IDisposable.Dispose. However, I recommend that you do not use the Dispose pattern for asynchronous cleanup. Why not? First off, an async version of Dispose would not work properly…
Async fixed concurrency workflows
In the previous post, I mentioned async fixed concurrency workflows as providing the best balance between resource utilization, latency, and throughput. Let’s explore two ways to build such a workflow. Single-threaded workflow The first design we will look at involves…
Designing for fixed concurrency
Consider a simple load test which is trying to maintain a constant stream of parallel requests against a server. That is, at any given moment the server should be handling, say, 100 concurrent requests. The exact number is not important,…
Async exclusive lock: integration test
In the previous post, I introduced my ExclusiveLock. In the typical TDD style, I ended up with a correct single-threaded implementation. However, as soon as I added parallelism and exception tracking to the basic integration test, I began hitting exceptions…
Building an async exclusive lock
The Monitor class is useful for establishing critical sections in your .NET code. However, this is of no use in asynchronous scenarios for at least two reasons: Monitor has thread affinity, meaning the same thread must acquire and release. Monitor…
MemoryChannel integration test
In a previous post, I discussed the concurrency issues with the initial MemoryChannel implementation and how unit tests were insufficient to uncover them. I came up with these basic requirements/invariants to guide my integration test design: Data from separately sent…