WriteAsync .NET

Testing, coding, in that order.

Real-time trace sessions with TraceEvent

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…

By Brian Rogers | 3 January, 2014 | diagnostics, tdd, testing | No Comments |
Read more

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…

By Brian Rogers | 1 January, 2014 | diagnostics | No Comments |
Read more

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…

By Brian Rogers | 30 December, 2013 | async, concurrency, diagnostics | 1 Comment |
Read more

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…

By Brian Rogers | 27 December, 2013 | diagnostics | 2 Comments |
Read more

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…

By Brian Rogers | 25 December, 2013 | async | No Comments |
Read more

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…

By Brian Rogers | 23 December, 2013 | async, concurrency, tdd | 2 Comments |
Read more

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,…

By Brian Rogers | 20 December, 2013 | async, concurrency, testing | 1 Comment |
Read more

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…

By Brian Rogers | 18 December, 2013 | async, concurrency, testing | 3 Comments |
Read more

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…

By Brian Rogers | 16 December, 2013 | async, concurrency, tdd | 3 Comments |
Read more

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…

By Brian Rogers | 13 December, 2013 | async, concurrency, testing | No Comments |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress