What’s New In .Net4.5

Though 4.5 version is released One year back but still there are many questions like what is new in DotNet 4.5

Let’s Explore some of the most useful features of this version.

1> ASYNC AND AWAIT

Async and await are markers which mark code positions from where control should resume after a task(thread) completes. Thus we can specify that what after and from where the control will be resumed after a long task.

 

2> REGEX TIMEOUT

We usually use regex for putting a regular expression validation for the various controls in a page. Sometimes if the input string is long then it takes time resulting in the late responses of the requests. This version of DotNet regulates a regex timeout period for a validation process.

3> GARBAGE COLLECTOR

Garbage collector is responsible for releasing the unused managed objects in the memory thus improving the performance and reclaiming of the memory space.Objects which are passed to the second generation of the garbage collector cycle are least frequently visited by the garbage collector for memory clearance so they keep wasting the memory. Current architecture runs a separate background thread which targets the second generation objects only , thus improving the garbage collector process.

4> SET DEFAULT CULTURE TO APP DOMAIN

 

In the previous versions of Dotnet we used to set the culture for individual threads but in multi-threaded applications this caused a ample of work for setting culture for all the threads.
In Dotnet 4.5 we can set the culture at the app domain level and all the child threads of app domain will inherit the culture.

 

For Example: 

CultureInfo GlobalCulture=CultureInfo.CreateSpecificCulture("En-US");
CultureInfo.DefaultThreadCurrentCulture=GlobalCulture;

There are many other interesting features . Keep Learning Keep Exploring.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s