Traditionally in Windows there is standard message loop that consist of GetMessage, TranslateMessage and DispatchMessage. There are variations but most cases it is like this. One popular case is to use PeekMessage instead of GetMessage. Usually this message loop is in center of your application and in many modern frameworks it is not even visible. It is mostly hidden from developer.

But in some cases, it is required to create your own message loop. There are many cases when it is beneficial to do. As result there is main message loop that processing messages and in a reaction on some message, second message loop is started. Then in reaction on

Recently I got new computer and I prefer to install everything by myself. On of the programs I use is FAR. Basically it is file manager. It is quite powerful application and it is mostly used by people who work professionally on computer. It resembles old good Norton Commander and it is console application.

Anyway, after I installed it, I found that colors are weird. Initially I thought it is something in video driver settings but after some time I found that all other colors look correct.

Here how it looks on new PC:

And here how it looks on old PC:

Firstly, I would like to setup context. Few years ago, in company where I work decided to upgrade 256GB SSD to better ones. I did research and found that 512GB Samsung 850 EVO. This is great SSD and it works quite well for like 4 years. But eventually it filled up and I had to move some stuff to HDD and finally I decided enough is enough and ask our IT department to buy 1TB disk. I specifically asked for 860 EVO 1TB disk. After one week I got my disk and was happy user since.

Later I was asked to investigate problem with checking out data from one of our source control servers. At the same time, I got

Monitors

For very long time computer screen had ratio of width to height equal to 4:3. Common resolutions were 640x480, 800x600, 1024x768. Every person who works with computer knows the more you can fit vertically the better. You can fit more text when you type or when you read. If you edit pictures, they also tend to be close to 4:3 ratio. But 24” monitor with 4:3 ratio requires much more pixels than say 24” with 16:9 ratio. About 15 years ago LCD panels were expensive. Nobody wants to buy panel with defective pixels and the less pixels the more chance to have no defective pixels. And manufacturers started to sell widescreen monitors. As result when consumers see 24” monitor

Many of you seen code like this:

public async Task Func()
{
    await SomeFuncAsync().ConfigureAwait(true);
    SomeOtherFunc();
}

Let’s assume that this code is executing in main application thread. Is it possible that SomeOtherFunc will be executed not in main application thread? Answer is yes. Let me explain why.

Here is really really simplified version of what compiler will do with our function:

public Task Func()
{
    Task task = SomeFuncAsync();
    SynchronizationContext context = SynchronizationContext.Current;
    task.ContinueWith(finishedTask => context.Post(state => { SomeOtherFunc(); }, null));
    task.Start();
    return task;
}

It actually looks completely different but from point of SynchronizationContext it looks close enough.

In short, when task will finish, it will execute provided callback in