Strategies for Implementing POSIX Condition Variables on Win32

This article illustrates why developing condition variables on Win32 platforms is tricky and error-prone. There are several subtle design forces that must be addressed by developers. In general, the different implementations we've examined vary according to their correctness, efficiency, fairness, and portability. No one solution provides all these qualities optimally.

The SignalObjectsAndWait solution in Section 3.4 is a good approach if fairness is paramount. However, this approach is not as efficient as other solutions, nor is it as portable. Therefore, if efficiency or portability are more important than fairness, the SetEvent approach described in Section 3.2 may be more suitable. Naturally, the easiest solution would be for Microsoft to simply provide condition variables in the Win32 API.

The C++ source code for POSIX condition variable on Win32 described in this article is freely available with the ACE framework at //

Introducing the USB Stick of Death

One of the obvious steps that we took to test the reliability of the file system management implemented in ntfs.sys was running a trivial bit-flipping fuzzer to see if we could reproduce any interesting behavior (such as a system crash) with such simple techniques. The first indicator of a possibly serious bug – a Blue Screen of Death – was encountered after roughly 17 hours of fuzzing time on a single laptop, and looked like the following...

DebugDiag 1.2 installation issues

This is the shortest way of installing DebugDiag 1.2 on Windows 7 Home Premium PL (non-English O.S.).
Installation on non-English systems fails because of lack of presence of "Users" group.
It is really frustrating to fight with installation of this wonderful toy so many times.

Follow these instructions:

I made it that way personally.
1. Download DebugDiag 1.2. from
2. Save it to c:\a\
3. Start elevated command line
4. cd "c:\a"
5. msiexec /a "c:\a\DebugDiagx64.msi" /qb TARGETDIR="C:\Program Files\"
6. cd "C:\Program Files\DebugDiag"
7. "Register.bat"
8. Close command line

Now you can run DebugDiag or DebugDiagAnalysis. But I had another problem at this point.
I could not view reports of analysis.
There was a message about error of running ShellCommand with error code 5 (ACCESS_DENIED).
I had no program associated with *.mht files.
1. Start iexplore
2. Open one of *.mht files. They are located
C:\Users\YourUserName\AppData\Local\VirtualStore\Program Files\DebugDiag\Reports
3. Right click on file and associate it with Internet Explorer
4. Allow any ActiveX controls.
5. Enjoy

P.S. Here you can fine some struggles of other people :)

P.S.2. I hope that I didn't miss anything.

(not) Threadsafe Events

"Callbacks" (usually events in C#) have always been problematic for multithreaded programming. This is because a good rule of thumb for component design is: Do your best to allow the event handler to do anything. Since "communicate with another thread that is attempting to take any lock" is one example of "anything", a natural corollary of this rule is: Never hold locks during callbacks.

A general-purpose solution does not exist, and all other solutions have serious drawbacks (placing severe restrictions on the actions available to the event handler).

Dependency injection

One benefit of using the dependency injection approach is the reduction of boilerplate code in the application objects since all work to initialize or set up dependencies is handled by a provider component.

Another benefit is that it offers configuration flexibility because alternative implementations of a given service can be used without recompiling code. This is useful in unit testing, as it is easy to inject a fake implementation of a service into the object being tested by changing the configuration file, or overriding component registrations at run-time.

Furthermore, dependency injection facilitates the writing of testable code.

Design Patterns: Elements of Reusable Object-Oriented Software

W sumie taka sobie 3/5. Przegadana. Wystarczy przekartkować.

1. Introduction
What Is a Design Pattern? * Design Patterns in Smalltalk MVC * Describing Design Patterns * The Catalog of Design Patterns * Organizing the Catalog * How Design Patterns Solve Design Problems * How to Select a Design Pattern * How to Use a Design Pattern

2. A Case Study: Designing a Document Editor
Design Problems * Document Structure * Formatting * Embellishing the User Interface * Supporting Multiple Look-and-Feel Standards * Supporting Multiple Window Systems * User Operations * Spelling Che cking and Hyphenation * Summary

Design Pattern Catalog

3. Creational Patterns
Abstract Factory * Builder * Factory Method * Prototype * Singleton * Discussion of Creational Patterns

4. Structural Pattern
Adapter * Bridge * Composite * Decorator * Facade * Flyweight * Proxy * Discussion of Structural Patterns

5. Behavioral Patterns
Chain of Responsibility * Command * Interpreter * Iterator * Mediator * Memento * Observer * State * Strategy * Template Method * Visitor * Discussion of Behavioral Patterns

6. Conclusion
What to Expect from Design Patterns * A Brief History * The Pattern Community * An Invitation * A Parting Thought

Gaiman on Copyright Piracy and the Web

Skoro wszędzie o ACTA...

Professional Visual Studio 2010 (Wrox Programmer to Programmer)

Bardzo fajna

XAML Editors

Microsoft Expression Blend 4


Opis kilku darmowych

Client-Side Reporting with Visual Studio in C#

Aktualnie na tapecie

Pro WPF in C# 2010: Windows Presentation Foundation in .NET 4

Przeczytana, polecam


Tomasz Kulig