WriteAsync .NET

Testing, coding, in that order.

Tasks do scale (well enough)

I’ve said it before and I’ll say it again: threads don’t scale. But what about Tasks? Here is a simple application which spawns a large (configurable) amount of periodic background tasks: The tasks themselves are technically CPU bound, though they…

By Brian Rogers | 30 December, 2015 | async, diagnostics | No Comments |
Read more

Async or non-blocking?

It is often helpful to distinguish between “truly async” code and merely “non-blocking” code. A program that dispatches long running operations to the thread pool would generally be non-blocking since it doesn’t tie up the calling thread. In contrast, a…

By Brian Rogers | 23 December, 2015 | async | No Comments |
Read more

Efficient concurrency prevention

Sometimes you want asynchrony but not concurrency. For example, if you are writing data to a file, you should generally prefer asynchronous I/O, but you probably don’t want 10 other competing callers to corrupt the contents. Perhaps the simplest way…

By Brian Rogers | 16 December, 2015 | async, concurrency, testing | No Comments |
Read more

Managed interop for native overlapped

Previously, I shared a basic sample for overlapped I/O with modern C++. I say “basic” but truth be told, there are multiple subtle aspects that one must be keenly aware of to avoid memory leaks or corruption. Thankfully, most of…

By Brian Rogers | 9 December, 2015 | async | No Comments |
Read more

The wait is over: coroutines in C++

Long ago, I wrote about using the PPL to achieve a .NET 4.0 level of parity for async programming in C++. Since then, a lot of work has gone into raising this level of parity to .NET 4.5 and beyond.…

By Brian Rogers | 2 December, 2015 | async, native | 3 Comments |
Read more

Distributed systems math: availability

Who doesn’t like math? (Rhetorical question, do not answer.) Today we’ll look at some simple math calculations which can help you approximate the overall availability of a distributed system. This model will assume a quorum-based protocol where a simple majority…

By Brian Rogers | 25 November, 2015 | distributed, math | No Comments |
Read more

Productize or perish

All things being equal, a technology developed for and sold to an external audience is going to be superior to an internal tool fulfilling the same role. After all, the captive marketplace is not known for its ability to produce…

By Brian Rogers | 18 November, 2015 | design | No Comments |
Read more

Just for the test of it

Ian Cooper implores you to test behaviors, not implementation details. His video “TDD, where did it all go wrong” expands on these points a bit. The summary is that a bunch of really thorough tests with explicit inner knowledge will…

By Brian Rogers | 11 November, 2015 | design, tdd | No Comments |
Read more

DRY RAII with AutoBuffer

Don’t Repeat Yourself is a good maxim in software design — avoid duplication of information. Today’s sample code will show a small fix to a problem which quite literally involves repeating yourself: those annoying “call twice” Win32 functions like GetVirtualDiskPhysicalPath.…

By Brian Rogers | 4 November, 2015 | design, native | 2 Comments |
Read more

Design for disaster: the small stuff

Is your system designed with disaster recovery in mind? There are obvious things like taking backups of state (and maybe validating them, too) and configuring geo-replication to mitigate the effects of regional outages. But what about the more subtle aspects…

By Brian Rogers | 28 October, 2015 | design, diagnostics, distributed | No Comments |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress