IntelliTrace

It is difficult and time consuming to track down bugs. Visual Studio 2010 Ultimate has a new feature called IntelliTrace to help. It collect data while application is executing. The collected data is called IntelliTrace events. There are about 150 of such events. They are collected by default, and stored to disk for each session.

IntelliTrace is being marketed as providing the right information at the right time. It helps you determine the exact steps required to reproduce a problem. A certain amount of information is collected by default. You can “turn up the dial” to get even more data collected.

The IntelliTrace logging only works for managed apps. It assists with viewing the prior state of an application without restarting the app. In the end this helps you diagnose problems quicker. You can also set up the tracing to perform custom actions when things go wrong. As an side you don’t need to have symbols present for IntelliTrace to work.

Visual Studio 2010

Visual Studio 2010 has a number of big changes in it. This version implements new standards changes from C++0x. It also uses MSBuild to do all builds. Finally Microsoft is updating the Microsoft Foundation Classes (MFC). There are also a host of other little changes in the latest version as well.

The C++0x changes include lamba expressions. These are unnamed function objects, and are handy to customize the Standard Template Library. The auto keyword from C++ is being changed to mean a variable type can be inferred by its initializer. There is a new static_assert which allows assertions to be tested at compile time. A new nullptr will enforce type safety for null pointers, replacing NULL (which by the way is not being deprecated yet).

MSBuild is the tool previously using to compile C# and VB code. Now it will be used for all Microsoft language compilation. MSBuild is an extensible build engine that uses XML. Microsoft is also finally enhancing the MFC library. This is mostly to take advantage of new APIs in Windows 7. You can recompile your MFC app with the new Visual Studio and get Windows 7 behavior immediately. The MFC Class Wizard is also back in the IDE.

The C++ standard library is being rewritten to take advantage of the C++0x feature set. Parallel programming efforts have been advanced. The new C++ project extension is now vcxproj. Multi touch is supported. There is Restart Manager support so your apps can save their state before they are terminated. The next version of Visual Studio is poised to pack a big punch for developers.

SQL Server Woes

I got a copy of a SQL Server 2005 backup file. It had information I wanted to mine. The problem was that I did not have SQL Server 2005 actually installed. I had trouble finding an evaluation copy of MS SQL Server 2005. Come on Microsoft. The only thing I could find was SQL Server 2008. I did find SQL Server 2005 Express, which is a free edition.

I ended up choosing something calls the advanced tools edition. The download of SQL Server was a couple hundred megabytes from Microsoft. The install would not run. The install itself needed the .NET framework 2.0.

So I went out and downloaded the .NET framework 2.0. Then SQL Server complained that my system did not meet its requirements. I needed Internet Information Server as well. I decided to proceed with the SQL Server install anyway.

SQL Server allowed me to bring up something that looked like an enterprise manager. I kept getting errors as I tried to restore the backup file. This experience reminded me of the pain I encountered when trying to install IBM DB2. I tell you what. Oracle Express was a lot easier to set up that SQL Server. This install experience from Microsoft was a fail.

Windows Phone 7 Series

Windows programming legend Charles Petzold is giving free access to his book on Windows Phone 7 Series programming. Who better to learn from than the guy who taught us Windows programming in the first place.

I only read a chapter or two. But I have gained some good insight. Let me share what I know with you here. First off grab the Windows Phone Developer Tools. That includes Visual Studio 2010 Express for Windows Phone. You also get a Windows Phone Emulator.

Windows Phone 7 is supposed to come out by the end of the year. Nobody seems to have any such actual phones yet. You can use two technologies to develop phone apps. They are Silverlight and XNA. In general use Silverlight for apps and utils, while XNA is best for performance games.

Currently Windows Phone 7 Series application must be managed code using the .NET framework. The only supported language is C#. You sell your apps in the Windows Phone Marketplace. Sound familiar? The hardware can come with two screen resolutions: 480x800 and 320x480.

This is going to be a brave new world of programming. You know it is hot if Charles Petzold is covering it.

Hyper-V

Some time ago, I read an advertisement in InfoWeek for Microsoft’s Hyper-V. The tag line was “your potential, our passion”. That sounded more like hype than hyper. However it was something to look into.

Hyper-V is the technology with code name Viridian. Previously this was known as Windows Server Virtualization. It implements virtualization based on a hypervisor. The hypervisor allows multiple operating systems to share on resource. This is a different level of abstraction than multitasking. The hypervisor actually protects the operating systems from failures other instances encounter.

Initially the Hyper-V was released in beta as part of Windows Server 2008. There are now two release versions of this product. There is a stand alone version. And there is the version that is a part of Windows Server 2008 R2.

The stand alone version is called Microsoft Hyper-V Server 2008 R2. This version is free. It has limited Windows services. It also makes you use the command line interface to do management. The other version is part of Microsoft Windows Server 2008 R2. This part is called the Microsoft Hpyer-V server. It is a core part of Windows Server 2008. It boasts point and click administration.

The parent operating system must be Windows Server 2008. Child partitions host guest operating systems that run virtually. These virtual partitions cannot directly access the physical hardware. The supported guest operating systems include Windows Server 2000/2003/2008, Windows 7, Windows Vista, and SUSE/RedHat Linux.

Hyper-V does not natively support USB devices. It also does not support sound in the guest operating systems. If you use the display drivers from Vista, you might encounter some performance problems.

Silverlight Versus AIR

Microsoft’s Silverlight and Adobe’s AIR are comparable products. They compete directly. Silverlight is a complete framework. The latest versions (Silverlight 4 and AIR 2) are still in beta.

Microsoft is not as much into design. This might be changing a bit with Silverlight. It allows you to perform design and development in parallel. Silverlight uses the XAML format to describe everything. C# and therefore Silverlight are good for large projects. The .NET developers will feel at home with Silverlight.

It is hard to change your design in Adobe AIR once it is complete. A good thing about Adobe is its huge installed user base. Approximately 98% of personal computers have Adobe Flash installed now. Compare this to an optimistic 34% of PCs which have Silverlight installed.

You should go the Silverlight way if you want your app to run on both the web and the desktop. There are a lot of .NET developers out there that can move to a Silverlight development. Silverlight also makes use of the mature .NET platform. Like other environments from Microsoft, Silverlight comes with a lot of good tools.

A drawback to Silverlight is that it really has to run on the Windows platform. There is a Moonlight product that is an open source version of Silverlight. However it does not come from Microsoft. It also lags the new stuff in Silverlight by about one version. You should also probably choose Adobe if you are going to be developing mobile applications.

Concurrency Visualizer


Parallel programming is difficult. You need to understand what bottlenecks are holding your app performance back. There is a new tool by Microsoft which can help profile your app. It can assist in finding places where parallelization makes sense. Let’s first understand some theory so we can appreciate the tool.

One CPU actually has many microprocessors in it. This physical core can run multiple threads. The official name for this is Simultaneous Multithreading (SMT). Intel markets this as hyper threading. Logical cores refer to the number of threads that can be running at the same time. This is related by different than the number of physical cores.

So what does this new Concurrency Visualizer tool show you? You can see where your app spends a lot of serial CPU time. You can also inspect how parallel the app already is. Finally you can see whether other applications are affecting your app’s performance.

Here is one note. Heavy file I/O can drastically impact performance. But it may be hard to tell the exact source of the problem. I/O is generally buffered. So the problems may build up before you actually see them. By then it is difficult to get to the root cause.

Multithreading is good up until your thread gets blocked. These can be many different causes for a block. Your own code may be doing synchronization. Or your thread might get preempted by another. Your thread could explicitly do a sleep. Or file I/O could cause you to wait. Finally you might be doing some GUI work to make sure the app seems responsive.

There is a lot more I can say about Concurrency Visualizer. But I am out of time. Just beware that the trace logs might get huge. And it is best to run it first with a small number of other apps running. Go try the tool out for yourself.