Asynchronous programming in .NET survey

Update:  The survey is now closed.  Thanks to all that participated!

 

We’ve heard our customers’ frustrations with asynchronous programming and their call for improved support.  We are hoping to better understand why and how you and your customers use asynchronous programming in .NET and how the support we provide for it can be improved in the future.

 

We invite you to complete a short survey on the Asynchronous Programming Model (APM) as well as on a theoretical language construct called “Asynchronous Methods.”  Completing this survey shouldn’t take more than 5-10 minutes of your time, and doing so will help us to better understand where the APM is lacking, how we can make asynchronous programming better and, ultimately, how we can increase your productivity and the scalability and reliability of your code. We encourage you to forward this message on to others who may also have had experience with asynchronous programming.

 

http://deploy.ztelligence.com/start/index.jsp?PIN=15TMLTB8M3X9C

 

Thank you!

 

Josh Phillips

 Asynchronous programming in .NET survey

Interested in parallel computing? We’re hiring!

If you’re reading this post, you most likely have an interest in parallel or distributed computing, writing concurrent software, and the like.  Take that interest a step further, and help us make the manycore era a successful reality by coming to work on the Parallel Computing Platform team at Microsoft.


We currently have several positions available:



If you’re interested in any of these, please submit your resume through the “Submit Resume” link on the relevant page. We look forward to receiving it!

 Interested in parallel computing?  We’re hiring!

Parallel For Loops over Non-Integral Types

In a previous post, it was demonstrated how for loops with very small loop bodies could be parallelized by creating an iterator over ranges, and then using Parallel.ForEach over those ranges.  A similar technique can be used to write parallel loops over iteration spaces of non-integers.  For example, let’s say I wanted to parallelize the following loop, where the iteration range is based on doubles:



for(double d = 0.0; d < 1.0; d += .001)
{
    Process(d);
}


Parallel.For only contains overloads for where the iteration variable is an Int32 or an Int64.  To accomodate doubles, one approach would be to translate the range into an integer-based range in order to use Parallel.For, and then within the body of the loop translate it into a double.  As an example, the previously shown loop could be rewritten as:



Parallel.For(0, 1000, i =>
{
    double d = i / 1000.0;
    Process(d);
});


Due to floating point arithmetic, this may not be exactly the same, but it may be close enough.  Another approach is to implement an iterator like the following:



private static IEnumerable<double> Iterate(
    double fromInclusive, double toExclusive, double step)
{
    for(double d = fromInclusive; d < toExclusive; d += step) yield return d;
}


With that Iterate method, now I can parallelize the sequential loop using Parallel.ForEach:



Parallel.ForEach(Iterate(0.0, 1.0, .001), d =>
{
    Process(d);
});


This same technique can be applied to a wide variety of scenarios.  Keep in mind, however, that the IEnumerator<T> interface isn’t thread-safe, which means that Parallel.ForEach needs to take locks when accessing the data source. While ForEach internally uses some smarts to try to ammortize the cost of such locks over the processing, this is still overhead that needs to be overcome by more work in the body of the ForEach in order for good speedups to be achieved. 


Parallel.ForEach has optimizations used when working on indexible data sources, such as lists and arrays, and in those cases the need for locking is decreased.  Thus, performance may actually be improved in some cases by transforming the iteration space into a list or an array, which can be done using LINQ, even though there is both time and memory cost associated with creating an array from an enumerable. For example:



Parallel.ForEach(Iterate(0.0, 1.0, .001).ToArray(), d =>
{
    Process(d);
});


Happy coding.

 Parallel For Loops over Non Integral Types

Coquette Part 5

25 May, 2009

Coquette Part 5 Preview Image

50 Icons

Following up on the Coquette series: Coquette part 5! The fifth part of the Coquette icon series is finally here and we can’t make a promise this will be the last part. We’ll continue upgrading the Coquette icons as long as there’s interest from our users. We’ll stop when you have enough. Coquette part 5 is powered by another 50 new icons.
“Coquette” free icon set contains 50 high quality, free icons in these sizes: 16×16px, 32×32px, 48×48px, 64×64px and 128×128px and 32-bit transparency PNG file format.

Business wordpress premium theme

Preview - Business

Business

Business wordpress theme – unique CMS template for wordpress, it is supplied with 7 additional widgets from NattyWP, and additional color schemes. The module for color managing will help you to change the background color and color design of one or few blocks, which will enable you to create a unique color design thus making your site memorable.

Nostra wordpress premium theme

Preview - Nostra

Nostra

Nostra is a Business wordpress theme. These theme can be configured easily, it is supplied with 7 additional widgets from NattyWP, and additional color schemes. The module for color managing will help you to change the background color and color design of one or few blocks, which will enable you to create a unique color design thus making your site memorable.

News Hunter wordpress premium theme

Preview - News Hunter

News Hunter

NattyWP would like to announce a new attractive theme for news websites! We created a perfect and clear news/magazine style and ready to present it, showing the wide range of offered facilities. This one – is the best theme we’ve ever create with the most versatile layouts! The versatility is kept by some powerful functionality including the all new News slide display system, category management and much more. Convenient admin interface allows fully customize the layout, as well as the functionality of separate modules topic. The topic functional can define different displays of news homepages, as well as pages of archives. That`s mean, that you can display news on the main page the following ways: creating two categories with two columns; one category and one column; designing one category but with two columns. The same actions you can use for archives!