WriteAsync .NET

Testing, coding, in that order.

Avoiding memory leaks: part 2

In the previous post I introduced some of the common cases for avoiding memory leaks with judicious use of unique_ptr. Of course, not all memory management situations are as straightforward, especially when dealing with low-level “C-style” APIs. Let’s explore a…

By Brian Rogers | 19 February, 2014 | design, native | No Comments |
Read more

Avoid memory leaks by design

There are many tools and techniques out there to help detect memory leaks. For instance, you can monitor performance counters for unexpected memory growth. Once a leak is suspected, UMDH might be able to help you pinpoint the culprit. However,…

By Brian Rogers | 17 February, 2014 | design, native | 1 Comment |
Read more

Native InputQueue thread-safety

In the previous post, I introduced my port of InputQueue to C++. As usual, the unit tests drove the creation of a correct single-threaded implementation but slightly more needed to be done to make the code thread-safe. The go-to construct…

By Brian Rogers | 14 February, 2014 | async, concurrency, native | No Comments |
Read more

Porting InputQueue to C++

In the previous post, I gave a brief intro to the PPL and the basic constructs for writing async C++ code. In this post, I will discuss the highlights of how I ported the InputQueue sample to C++ using the…

By Brian Rogers | 12 February, 2014 | async, native, tdd | No Comments |
Read more

Async in C++ with the PPL

The Parallel Patterns Library (PPL) provides C++ developers with some very useful concurrency primitives along similar lines as Task parallelism in .NET. Having been introduced in Visual Studio 2010, the PPL is not new by any means. However, it remains…

By Brian Rogers | 10 February, 2014 | async, native | 4 Comments |
Read more

Testing down low

In the last post, I discussed high-level testing of a simple distributed service. Now let’s look at the bottom of the stack. What are good candidates for testing at this level? To name a few: Basic functional/algorithmic correctness Unit/module cohesion…

By Brian Rogers | 7 February, 2014 | testing | No Comments |
Read more

Testing from up high

In the previous post, I introduced a simple distributed service and some considerations that might drive a test planning effort. In this initial drill down, I will take a look at the tradeoffs of testing this system “from up high”…

By Brian Rogers | 5 February, 2014 | distributed, testing | 1 Comment |
Read more

Testing at the right level

A large-scale distributed service is deployed to a datacenter across hundreds of machines. The basic topology is as follows: Consider the following scenarios and requirements: The service should respond with an error if a client requests a nonexistent resource. The…

By Brian Rogers | 3 February, 2014 | distributed, testing | No Comments |
Read more

InputQueue use cases

In my previous post, I introduced InputQueue. Now for some (hopefully) realistic examples of how you can use it. Perhaps the most obvious scenario is a command processor with an async dispatch loop, for example: This processor allows a single…

By Brian Rogers | 31 January, 2014 | async | No Comments |
Read more

InputQueue, the non-BlockingCollection

The .NET 4.0+ solution to the producer-consumer problem is BlockingCollection. A sample app with a single producer and consumer using an ordered queue of integers would look something like this: This is simple enough, but the problem is that DequeueLoop.…

By Brian Rogers | 29 January, 2014 | async, concurrency, tdd | 1 Comment |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress