How to stress and measure the Garbage Collector

Many years ago, I was writing real time applications for monitoring sound signals bouncing off submarines. That code (written in Fortran and PDP-11 assembly code) had to process the incoming sound at the rate of thousands of data points per second, doing real-time Fast Fourier Transforms and analyzing the results, printing graphs. Using a managed…

0

Using Async with ManualResetEventSlim

When I first started writing programs many years ago, my computer had only one processor and no notion of thread, because there was only one. Understanding code for it just meant following one “thread” of execution. I was trying to create a way to queue items to work on in a different thread than the…

0

Use reflection to get assembly type and method sizes for comparison

I wanted to know what changed between two versions of a managed assembly. Software changes over time, and seeing what changed can be important in understanding behavior.So I wrote a little program to show the assembly contents, sorted by size, showing the size of various components such as classes and methods. Because it doesn’t look…

0

Detouring code

  Microsoft Detours from Microsoft Research is a powerful technology to intercept operating system function calls and detour the call to your own code. This enables:  1.    Diagnostics: you can log callers, parameters2.    Replace functionality completely: the caller calls the WinAPI “MessageBox”, but it calls your version instead.3.    Modify functionality: perhaps change some parameters to…

0

Getting more disk space, Symbolic Links and Azure Virtual Machines

AzureAzure lets you get free virtual machines.What does this mean? You can use a free Azure account to create a new machine that only you can access, and can manipulate it as you see fit, almost as if you had a brand new computer to use (you can’t spill coffee on it). It can be…

0

Lasers bouncing off elliptical mirrors in C#

The NumberPhile Illumination Problem https://www.youtube.com/watch?v=xhj5er1k6GQ describes reflecting light beams off mirrored walls to see if all parts of an oddly shaped room can be illuminated. In the last 2 posts (Lasers reflecting off an ellipse  and  Reflect laser beams off multiple mirrors) I showed some code to simulate laser beams reflecting off multiple mirrors in…

0

Lasers reflecting off an ellipse

Various conic sections (hyperbolas, parabolas, ellipses) have interesting reflective properties. Parabolas are used for antennae and even car headlight and flashlight reflectors to focus a beam of light. In the last post https://blogs.msdn.microsoft.com/calvin_hsia/2018/02/28/reflect-laser-beams-off-multiple-mirrors I showed some code to bounce a laser off various mirrors that the user can draw on the screen. I also mentioned…

0

Reflect laser beams off multiple mirrors

In some science museums there are exhibits demonstrating the paths of light rays. A typical one might have a table with small walls consisting of blocks a few inches high, with each vertical face being a mirror. A small horizontal laser can be positioned anywhere on the table. Many blocks be placed on the table…

0

Store different derived classes in collections in C++ and C#: CoVariance, shared_ptr, unique_ptr

I wanted to create a collection container that would hold objects of various types, all derived from a common interface/base class.In C# and VB, this is easy. Just create a new List<MyBase>() and add elements to it, including various MyBase derived typesAdding elements that are more derived is Covariance (not to be confused with covariance…

0