|
|
Browse by Tags
All Tags » Programming » .NET » C#
-
When you are handed a string, integer, or any value type, can you know what it really represents? Can you define the range of appropriate behaviors for that data? Can you tell if it's formatted correctly? The problem is, in all of these cases, you can't. You can't be sure of it's meaning, it's format or even how to ...
-
After my last post, “A Safe and Asynchronous One to Many Stream Copy Through IL and Inheritance”, I ordered a few books and spent some time playing with generating IL. Along the way I’ve developed a library which allows you to make a franken-clone of any object. You pass the method an object to clone along with a hash table of values to change, it ...
-
Because .NET Streams have state, they are difficult to use in multithreaded environments. In this post I discuss ways to manage or work around problems arising from the statefulness of .NET Streams. I explain how this is possible both through traditional inheritance and also through some indulgence in hacking of object protection levels by ...
-
In the previous article I discussed a few of the benefits of stack allocation as well as a couple of C# keywords which help you to leverage those benefits. However, the one megabyte default stack size is too small for stack allocation to be used with a large dataset. Alternatively, in some threading situations one megabyte per thread/fiber can ...
-
Articles in This Series
Part 1 – Basic Housekeeping
Part 2 – Improving Performance Through Stack Allocation
Part 3 – Increasing the Size of your Stack
Part 4 – Choosing the Right Garbage Collector SettingsPart 5 – Changing Your Garbage Collector Settings on the Fly
Introduction
In C#, when you create managed objects or arrays of ...
-
There are a great number of different ways to count the number of processors available to the .NET developer. In this post I will go over some of the more common methods and their pros and cons.
The Envirionment.ProcessorCount Way
Code:
Environment.ProcessorCount;
Supported Platforms:
Windows 98 Or Greater, .NET 2.0 or ...
-
One of the most often cited reasons to not use .NET is that it is initially compiled to an intermediary language (MSIL) and has to be recompiled every time you run it. In many high performance environments this wasted time is simply unacceptable. To combat this Microsoft released a tool with .NET 1.1 called NGen (Native Image Generator) which ...
|
|
|