News

My Stats

  • Posts - 21
  • Comments - 20
  • Trackbacks - 0

Twitter












Recent Comments


Recent Posts


Archives


Post Categories


 

Windows Phone 7 and Windows Phone 7.1 codename Mango was the topic of the event held today in Helsinki at the Finnkino movie theater Tennispalatsi. Microsoft Finland had invited two top notch speakers from Redmond namely Brandon Watson and Jaime Rodriguez. Following the recent public announcement of the new version of the platform this was one of the first events on the subject.

The keynote of the event mostly concerned the overall vision and idea of the Windows Phone 7 platform but the following sessions went into more detail about actually working with the platform. Especially interesting were the new features of Mango and it’s performance optimizations, so I’m mostly going to talk about them here. This post does not contain an extensive list of all the new features but I’ll try and elaborate on what I see as being most noteworthy.

The first feature that I feel is very important especially for applications like games on the Windows Phone is the new garbage collector. This GC is finally generational meaning that having a lot of small long living objects does not kill performance anymore. I’m sure that all my readers know what a generational garbage collector is but for those who don’t, it’s basically a garbage collector that groups older objects and younger ones into distinct sets that are traversed separately. This means that young objects can be traversed separately by root finding (i.e. if the object is still used somewhere) while old objects don’t necessarily  need to be checked.

The good thing here is that in XNA it’s now a lot more efficient to allocate single instances of Vector3, for instance, instead of doing what was previously recommended and allocating large arrays and reusing them. Doing the later is still not a bad thing, though.

There is also new sensor support coming with the Mango release. We will now get an API for the compass. Wohoo! The option of a compass has always been there in the specs but up until now there has not been an API for it. There’s also the gyroscope that will be added to the hardware spec and API as an optional device.

Another great thing coming with Mango is the concept of background tasks. The developer has the ability to register three different types of tasks that each have their own unique purpose. There are two general types of tasks, active tasks as well as on-idle tasks. On-idle tasks are executed when the phone is not in a cellular network and is on AC power. There is also a task type dedicated for playing background audio. These tasks are limited in how much processing power they can consume and how large their memory footprint can be.

There’s one more great feature that can be expressed with a single word: sockets. Finally we have the ability to use sockets for communication enabling real-time gaming on the internet and truly bringing the Microsoft three screens vision to life!

As is typical of me, I talked with mister Rodriguez about how the Microsoft C++ endeavors affect the Windows Phone roadmap and it turns out that Microsoft is working hard to solve a number of issues related to exposing a C++ API. This is something we knew already so nothing much to report there. But we have our hopes high, however, and I’ll keep my ears pointed in what is hopefully the right direction.


 

We all know how at some point a small typo can result in odd application behavior even if the source code it self compiles. One issue that pops up from time to time is missing the ‘&’ character and thus declaring a variable inadvertently as not being a reference.

void SomeMethod()
{
    // ...

    RRArray<RRInt_t> rIndices = pSubMesh->GetIndices();

    // ...
}

Just recently I ran into this kind of a situation where I had a method that contained this kind of an invalid variable definition (GetIndices returns a reference to an instance of RRArray<RRInt_t>). The bug was actually quite hard to track down, since problems popped up only after the object referenced by pSubMesh was destructed.

First of all I had not explicitly defined a copy constructor for RRArray. This meant that the default copy constructor just copied the internal array pointer to the new instance. When the scope of rIndices was left the object’s internal memory was released. When the array object owned by the sub mesh was destructed, however, that same internal memory had already been released.

This doesn’t happen that often but when it does, it’s quite hard to spot it as the problem might seem quite disjoint from it’s consequences.


 

TechEd 2011 got us talking about the next Visual Studio version called vNext. The update adds multiple small and subtle performance improvements as well as major new ALM tools. These tools focus on helping developers work in the so called Virtuous Cycle, which consists of development and operation in a continuous loop.

The major tools concentrate on requirements gathering, agile planning, stakeholder feedback, test coverage analysis and much much more. You can see the full session by Cameron Skinner here.

This is all good but we C++ developers soon began thinking, what about us? Are we getting these tools as well? The answer is yes! And we’re also getting a lot of the tools that we have been missing up until now. The only major things that don’t work in C++ are code cloning and IntelliTrace.

Terry Leeper and Rong Lu held a session on this subject. The full session can be seen here. Especially neat are the architecture tools that give you a better view on the structure of your existing application and do a great job at helping you during designing as well.

As you might have guessed Microsoft has changed their attitude towards C++ development having realized that C and C++ are still the second and third most popular programming languages right after Java. This new initiative is called the C++ Renaissance because Microsoft is working hard to reconnect with the C++ community. So keep reading blogs and stay tuned for more C++ candy!


 

This is my first blog entry on geekswithblogs.net. I will mainly be blogging about my experiences in C/C++ and Visual Studio but I will also blog about other technologies and languages when something interesting comes along.

So stay tuned for more!