Uneven Work Distribution and Oversubscription

October 23, 2013

A few days ago I was teaching our Win32 Concurrent Programming course and showed students an experiment with the std::thread class introduced in C++ 11. The experiment is designed to demonstrate how to partition work across multiple threads and coordinate their execution, and the work to partition is simply counting the number of primes in a certain interval. You can find the whole benchmark here. The heart of the code is the parallelize_count function, below: void parallelize_count(unsigned nthreads, unsigned begin, unsigned end) {     std::vector<std::thread> threads;     unsigned...
no comments

On ‘stackalloc’ Performance and The Large Object Heap

October 17, 2013

An interesting blog post is making the rounds on Twitter, 10 Things You Maybe Didn’t Know About C#.  There are some nice points in there, such as using the FieldOffset attribute to create unions or specifying custom add/remove accessors for events. However, item #4 on the list claims that using stackalloc is not faster than allocating a standard array. The proof is given in form of a benchmark program that allocates 10,000 element arrays – so far so good – and then proceeds to store values in them. The values are obtained by using Math.Pow. The benchmark results...
3 comments

Talks from DevConnections 2013: Advanced Debugging with WinDbg and SOS, Task and Data Parallelism, and Garbage Collection Performance Tips

October 10, 2013

I'm falling behind in documenting all my travels this fall :-) In the beginning of the month I flew out to Vegas for IT/DevConnections, which was my second Las Vegas conference this year. I've been there for just 48 hours, but it was enough time to deliver three talks, meet fellow speakers, and even have a few meaningful chats with attendees about the future of .NET and production debugging techniques. You can find my presentations below -- the last couple of slides of each presentations have some additional references and books that might be useful if you want to expand...

Talks from Software Architect 2013: Attacking Web Applications and First Steps in iOS Development

I'm starting my way back from Software Architect 2013, and already miss the conference's great vibe and attentive delegates. It's been a pleasure meeting and interacting with all of you, and I look forward to returning for next year's conference! On a more practical note, I've promised to share with you the presentations from the event. I had two this year -- Attacking Web Applications and First Steps in iOS Development. In the first talk, I tried to cover the most typical attacks used against web applications today, including CSRF, XSS, improper session management with cookies, SQL and OS command...
tags: , , ,
no comments

Integrating Windows Azure Mobile Services and Service Bus Notification Hubs

October 7, 2013

This is one of the longest blog titles ever, and I’m still not using the full official feature names. AccessCheckByTypeResultListAndAuditAlarmByHandle, anyone? Scott Guthrie just announced recently that Windows Azure Service Bus Notification Hubs have reached the GA phase, which is a good opportunity to try them out. Notification Hubs are designed to blast out a large number of push notifications to a variety of connected devices, absolving you of the need to worry about client subscriptions, managing lists of clients per topic, handling different push APIs for different platforms, and managing dropped or expired push channels. From my...
no comments