I’ve just returned home from the Professional Developers Conference (PDC), a conference focused on new technology from Microsoft. A number of exciting announcements were made:
In addition, there were many strong technical sessions on C#, Visual Basic, Azure, parallel computing, Windows Workflow, Office development, Windows 7 development, SQL Azure, WPF, WCF, Silverlight, Surface development, xRM development, and much more. If you weren't able to attend the PDC, the sessions were videotaped and are available online at http://microsoftpdc.com/Videos.
I am very fortunately able to attend the Professional Developer Conference (PDC) this year. There are far too many great sessions to attend them all, but I’ve taken a rough stab at some of the sessions I’d like to hit. It’s so hard to choose…I like to attend sessions for multiple reasons:
- Content that I’m personally interested in
- Content that my customers are interested in, or that I know that I will have to present at some point
- Rockstar speakers. There are some amazing speakers at PDC who could talk about any topic and make it fascinating, so those are usually worthwhile to see.
Luckily, I’ll be okay without Hermione’s time-turner: all of the sessions will be recorded and posted online after the conference.
If you are also attending, feel free to say hi. I’ll be on Twitter (@jennifermarsman) throughout the conference.
Some of the events that I’m participating in are not open to the public, so I’ve marked those in italics.
Feel free to map out your own schedule at http://microsoftpdc.com/Schedule.
I arrive in LA on Sunday.
Monday
8am-6pm: DPE Field Summit (for DPE only). I’ll probably also stick my head in the Visual Studio 2010 Test Tools Deep Dive.
7-10pm: Party with Palermo. Get location details and register at http://pdc09.partywithpalermo.com/.
7:30-8:30pm: PDC09 Tweetup. Get location details and register at http://tweetvite.com/event/pdc09tweetup.
Tuesday
8:30-10:30am: Keynote
11am-noon: “Future Directions for C# and Visual Basic”, by Luca Bolognese
12:30-1:15pm: “Lessons Learned: Migrating Applications to the Windows Azure Platform”, by Wade Wegner OR “Dynamic Binding in C# 4”, by Mads Torgersen
1:30-2:30pm: “Windows 7 and Windows Server 2008 R2 Kernel Changes” by Mark Russinovich
3-4pm: “Windows Touch Deep Dive”, by Reed Townsend
4:30-5:30pm: “Code Contracts and Pex: Power Charge Your Assertions and Unit Tests” by Mike Barnett and Nikolai Tillmann OR “Code Visualization, UML, and DSLs” by Cameron Skinner OR “Manycore and the Microsoft .NET Framework 4: A Match Made in Microsoft Visual Studio 2010” by Stephen Toub
6:30-9pm: Mixer with customers (by invitation only)
Wednesday
8:30-10:30am: Keynote
11am-noon: “Microsoft Perspectives on the Future of Programming” (lots of big-name panelists) OR “Developing .NET Managed Applications Using the Microsoft Office 2010 Developer Platform” by John Durant OR “Development Best Practices and Patterns for Using Microsoft SQL Azure Databases” by Nigel Ellis
noon-1:30pm: Women in Technology Networking Lunch
1:30-2:30pm: “Developing Advanced Applications with Windows Azure” by Steve Marx OR “Spice Up Your Applications with Windows Workflow Foundation 4” by Matt Winkler
3-4pm: “The State of Parallel Programming” by Burton Smith OR “Scrum in the Enterprise and Process Customization with Microsoft Visual Studio 2010” by Simon Bennett and Stuart Preston OR “Windows Azure Tables and Queues Deep Dive” by Jai Haridas
4:30-5:30pm: “Storing and Manipulating Blobs and Files with Windows Azure Storage” by Brad Calder OR “Petabytes for Peanuts! Making Sense out of ‘Ambient’ Data” by David Campbell OR “What You Should Know About Windows Azure Platform Pricing and SLAs” by Dianne O’Brien OR “Developing with the Windows API Code Pack for Microsoft .NET Framework” by Yochay Kiriaty
7-9pm: GeekFest
7pm-1am: The Underground @ PDC09 – you can register at http://undergroundatpdc.com/ and follow @undergroundpdc on Twitter to get an invitation code!
Thursday
8:30-9:30am: “Embodiment: The Third Great Wave of Computing Applications” by Butler Lampson OR “Infer.NET: Building Software with Intelligence” by John Guiver and John Winn
10-11am: “Automating the Application Lifecycle with Windows Azure” by Sriram Krishnan OR “Windows Presentation Foundation 4 Plumbing and Internals” by Blake Stone OR “Axum: A .NET Language for Safe and Scalable Concurrency” by Niklas Gustafsson OR “F# for Parallel and Asynchronous Programming” by Luke Hoban
11:30am-12:30pm: “Building Amazing Business Applications with Microsoft Silverlight and Microsoft .NET RIA Services” by Brad Abrams OR “Multi-Touch on Microsoft Surface and Windows 7 for .NET Developers” by Anson Tsao and Robert Levy
12:45-1:30pm: “Build a .NET Business Application in 60 Minutes with xRM and SharePoint” by Barry Givens and Nikhil Hasija OR “Microsoft Visual C# IDE Tips and Tricks” by DJ Park OR “Microsoft Semantic Engine” by Naveen Garg and Duncan Davenport
1:45-2:45pm: “XAML Futures in Microsoft .NET Framework, Microsoft Silverlight, and Tools” by Michael Shim and Rob Relyea
3-4pm: “Power Tools for Debugging” by Sandeep Karanth and Kapil Vaswani OR “The Audience API: Live Framework Present and Future” by Todd Manion
Last week, Stephen Toub met with roughly 450 people on his Parallel Computing tour! He toured through Nashville, Louisville, Cincinnati, Cleveland, and Detroit, meeting with customers during the day and speaking at user group meetings in the evenings.
I promised that I would post some resources from Stephen’s tour.
Downloads
Stephen’s slide deck: Toub_ParallelismTour_Oct2009.zip
Download Visual Studio 2010 and .NET 4.0 Beta 2: http://go.microsoft.com/?linkID=9692084
Download the Parallel samples: http://code.msdn.microsoft.com/ParExtSamples (click the Downloads tab)
Blogs
Managed code parallelism: http://blogs.msdn.com/pfxteam (Stephen blogs here)
Native code parallelism: http://blogs.msdn.com/nativeconcurrency
Parallelism tools: http://blogs.msdn.com/visualizeparallel
I’ve also posted a few blog posts on this topic: Parallel Programming
Other Online Resources
Concurrency developer center: http://msdn.com/concurrency
Parallel forums: http://social.msdn.microsoft.com/Forums/en-US/parallelextensions/threads
Finally, David Giard interviewed Stephen as part of his “Technology and Friends” webcast series. If you missed Stephen, you can hear some of his thoughts here.
I’m excited to tell you that I’m organizing another product team tour! Stephen Toub from the Parallel Computing Platform team at Microsoft will be touring through Michigan, Ohio, Kentucky, and Tennessee in one week, speaking at corporations during the day and speaking at user groups in the evenings. He will discuss concurrency and how .NET 4.0 simplifies parallel programming. This is one of the things that I am seriously most excited about in .NET 4.0. With Moore’s Law breaking down, software developers need to be able to master multithreading and know how to develop concurrent applications. Historically, this has been very difficult. It’s hard to understand concurrency issues, hard to write good code, and hard to debug when race conditions and such do happen. With .NET 4.0, there are APIs and tools to make parallel programming much simpler. This in turn can result in improved performance of your applications.
Stephen will be speaking to the public in a number of venues. Please register as directed below. This is an amazing opportunity to learn about a cool new technology, directly from one of the people who built it. In addition, it’s always nice to build relationships with people on the .NET Framework team.
The official abstract and bio is below.
| Date/time | Location | Registration |
Mon 10/26, 9-11am | Microsoft office 2555 Meridian Blvd, Suite 300 Franklin, TN 37067 | http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032430034&Culture=en-US
|
| Mon 10/26, 6:30-8:30pm | Microsoft office 2555 Meridian Blvd, Suite 300 Franklin, TN 37067 | http://nashparalleldotnet.eventbrite.com/ |
Tues 10/27, 6-8pm | University of Louisville Campus J.B. Speed Hall, Room 100 Map | No registration required. |
Wed 10/28, 3-5pm | Microsoft office 4605 Duke Dr, Suite 800, Mason, OH 45040-9410 | http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032430039&Culture=en-US |
Wed 10/28, 6-8pm | MAX Technical Training 4900 Parkway Dr, Suite 160 Mason, OH 45040 Map | https://www.clicktoattend.com/invitation.aspx?code=141786 |
| Thurs 10/29, 9-11am | Microsoft office, Park Center III, Third Floor, 6050 Oak Tree Blvd S, Independence, OH 44131 | http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032430040&Culture=en-US |
| Thurs 10/29, 6:30-8:30pm | Sogeti office at Beacon Place Conference Center 6055 Rockside Woods Blvd, lower level Independence, OH 44131 | To register, please send an email to sam@clevelanddotnet.info with "RSVP" in the subject line. |
Fri 10/30, 6-8pm | Microsoft office, Southfield Town Center, 1000 Town Center Dr., Suite 1930 Southfield, MI 48075 | https://www.clicktoattend.com/invitation.aspx?code=142370 |
Parallel Computing with Visual Studio 2010 and the .NET Framework 4
With the .NET Framework today, correctly introducing concurrency and parallelism into libraries and applications is difficult, time consuming, and error-prone. However, as the hardware industry shifts towards multi-core and manycore processors, the key to high-performance applications is parallelism. The .NET Framework 4 and Visual Studio 2010 offer solutions to help make coding, debugging, and profiling concurrent applications significantly easier. In this talk, we’ll examine Parallel LINQ-to-Objects (PLINQ), the Task Parallel Library (TPL), new coordination and synchronization types, and Visual Studio tooling support in order to provide a look at the next generation of parallel programming with .NET.
Stephen Toub is a Senior Program Manager Lead on the Parallel Computing Platform team at Microsoft, where he spends his days focusing on the next generation of programming models and runtimes for concurrency, parallelism, and asynchrony. Stephen is also a Contributing Editor for MSDN® Magazine, for which he writes the .NET Matters column, and he’s an avid speaker at conferences like PDC, TechEd, and DevConnections. Prior to working on the Parallel Computing Platform, Stephen designed and built enterprise applications for companies such as GE, McGraw-Hill, BankOne, and JetBlue. He was a developer for Microsoft Outlook as well as for the Microsoft Office Solution Accelerators.
First, some background:
As an evangelist, part of my job is to deliver technical talks at user groups, conferences, corporations, and other events. One event series that my team drives is the MSDN Unleashed/TechNet Unleashed roadshows in multiple cities.
Last week, my colleagues Matt Hester, Brian H. Prince, and I spoke at a Windows Azure roadshow (“Real World Azure with Microsoft IT”) in Grand Rapids, MI. Matt presented on IT Professional topics in the morning, I presented on Developer topics in the afternoon, and Brian kicked off both the morning and afternoon sessions with Architect topics.
So, onto my story:
After lunch, we planned to run the afternoon sessions off my laptop, since Brian had to leave early to speak at another user group. He presents for about the first 45 minutes, and then I present the remaining 3 hours of the content. So we were plugging my laptop in to the A/V equipment, and it wouldn’t work with the projector. No matter what I did, it would not display on the screen. I tried all of the tricks that I knew (different resolutions, “Connect display” in Windows Mobility Center, the Win-P shortcut, “Connect to a Projector” in Windows 7, etc.) and then Brian tried all of the tricks he knew (which were the same tricks I knew)…nothing worked.
I had been having a lot of trouble with my Dell machine (it often protests with loud whirring noises and for a time it wouldn’t always reliably boot), but I had re-installed the operating system (taking the opportunity to move from Vista to Windows 7) and it had been more stable lately. I had rehearsed on that machine multiple times and everything had worked just fine, but just in case, I had brought my older Toshiba laptop as backup. So we moved to a quick Plan B: Brian would present on his laptop during his portion, and I would make sure that my Toshiba machine was ready to go while he was speaking. So Brian began his presentation, and I sat with Matt in the back to prep my Toshiba machine. Of course, there was a problem right away: one of my demos required Visual Studio 2008, and my Toshiba has Visual Studio 2005 and Visual Studio 2010 installed, but not Visual Studio 2008. I happened to have a VS 2008 installation disk in my laptop bag, but I doubted that the installation would complete by the time Brian was done talking. Then Matt had a great idea: my Dell’s hard drive had all of the right content (Visual Studio 2008, the proper Azure SDKs, slides, code, demos) but if hardware was the problem, we could swap that out. He had a screwdriver in his bag (mega geek points there!) and his laptop had a removable bay for hard drives. So, he performed a little open-heart surgery on our laptops! He literally opened up my Dell, removed the hard drive, fit it into the removable bay, and shoved the bay into his Lenovo. Then he powered up his Lenovo, booting to my hard drive.
I’ll confess: I was worried. I needed to speak in a half hour, and we were moving the hard drive with all of my content from a Dell to a Lenovo…completely different hardware. No way could this be easy.
Then, the thing of beauty! A dialog box popped up, found all of the drivers that would be needed, and then downloaded them all for me.
How amazing is that?!?!? With another operating system, I might have had to figure out what drivers were needed, go out to multiple websites, find the correct drivers, and install them individually. Instead, the entire process of moving the hard drive took maybe 30 minutes and only one reboot. I could access all of my programs, documents, and data from my hard drive, working within Matt’s laptop.
Whew! The show went on as planned. :) I LOVE YOU, WINDOWS 7!
Like many people, I love watching videos on the internet. Are you a consultant? Perhaps you can relate to this hilarious video on the vendor/client relationship. I am also a huge Harry Potter fan, and this “A Very Potter Musical” (created by students at the University of Michigan) is another shining example of the joy the internet brings me.
But, videos on the internet can do more than entertain…they also inform. One of the most useful resources that I use for learning new technology is “How Do I?” videos. These are short, 5-10 minute videos that demonstrate how to perform one specific task with a technology, such as “How do I deploy a Windows Azure application?” or “How do I animate paths in Silverlight?” Because they are so short and focused, it’s easy to watch them; I get so busy that I sometimes have trouble carving out an uninterrupted hour to watch a full-length talk, but I can squeeze in 10 minutes on a focused task that will help me do my job. Technologies covered include ASP.NET, AJAX, the Azure Services Platform, BizTalk Server, Data Platform Development, Devices, Internet Explorer, Office, Security, Silverlight, SQL Server, VB, C#, Visual Studio, VSTS, Visual Studio Tools for Office (VSTO), Windows Forms, and WPF. Check them out here.
Microsoft also has a whole website devoted to videos called Channel 9. The creation of Channel 9 is actually a pretty cool story. The inside scoop: a Microsoft employee was afraid of flying in airplanes. He was able to get over his fear partially because on United Airlines’ on-board entertainment system, conversations between the flight crew and air traffic control are broadcast on channel nine. Having this visibility into what the pilot was doing made a world of difference. And he thought, why can’t we do that for Microsoft? Thus Channel 9 was born, to give people a glimpse into the people of Microsoft with interviews and such, to convey technical knowledge, and to provide a channel to have a conversation between Microsoft and developers. Check it out here.
TechNet & MSDN Events Present:
Real World Azure with Microsoft IT
Come spend a day with us to explore Windows Azure™ – Microsoft’s platform for building and deploying cloud based applications – from a real world point of view!
During this event, we’ll review critical lessons Microsoft IT has learned migrating internal line-of-business applications to Windows Azure™.
What is Windows Azure™? When should I use it? How does it apply to my job? Whether you’re an IT Professional, Developer or Architect, we’ll address your top of mind questions about cloud computing.
TechNet Events Presents – for the IT Professional from 8:30am to noon
In this session, we will discuss:
- Azure architecture from the IT professional’s point of view
- Why an IT operations team would want to pursue Azure as an extension to the data center
- Configuration, deployment and scaling Azure-based applications
- The Azure roles (web, web service and worker)
- Azure storage options
- Azure security and identity options
- How Azure-based applications can be integrated with on-premises applications
- How operations teams can manage and monitor Azure-based applications
TechNet – Date/Location/Registration
MSDN Events Presents – for the Developer & Architect from 1:00pm to 5:00pm
In this session, we will discuss:
- Cloud computing architectures in general and the Azure architecture in particular
- Several aspects of Azure from the developer’s and architect’s perspective
- Azure roles (web, web service and worker)
- Azure storage options
- Azure security and identity options
- How Azure-based applications can be integrated with on-premise applications
- Configuration, deployment and scaling Azure-based applications
- How development teams can optimize their applications for better management and monitoring
MSDN - Date/Location/Registration
Multiple nonprofit organizations have asked me why developers would give up a weekend to help them, no strings attached. It's hard to say until you've experienced a Give Camp. The uncertain coming together on Friday night, not knowing what to expect...the gradual understanding of the project and your teammates...the friendship that develops over silly jokes when working late into the night with no sleep, and the natural bonding that occurs from working together on a selfless project...the final push on Sunday morning to make sure that everything is ready...and the closing ceremony, complete with tears and a sense of pride.
Columbus threw their first Columbus Give Camp last weekend, organized by Carey Payette and James Bender. Last year, Columbus ran a Give Camp as a satellite of the Ann Arbor Give Camp (assisting Michigan-based nonprofits) and this year they held a completely independent but simultaneous event.
There were 40-50 developer and designer volunteers present (plus 10-15 nonprofit representatives) throughout the weekend. They built software and websites for 7 nonprofit organizations:
Hopemongers Fairy Goodmothers Shiloh Baptist Church Family Institute College Choir Concert Series Volunteer Earth TECH CORPS Ohio Northwest Plains District Family Camp They were able to use a variety of different technologies in the projects:
- 2 Ruby
- 1 PHP (combining Joomla and Wordpress and Moodle sites)
- 4 .NET (1 DotNetNuke, 1 ASP.NET MVC, 1 WebForms, 1 regular ASP.NET)
Despite some technical difficulties with the network on the first night, it was an amazing event! I heard wonderful things about the space that Quick Solutions donated for the event. They provided breakout rooms in addition to a large open space, and a fast internet connection. In addition, they have a full kitchen and even emptied the refrigerator for the visiting developers to use.
They certainly ate well! Pei Wei provided hundreds of dollars of food for free, and Pot Belly Sandwiches gave a generous discount on their food order. Discount ASP.NET provided free hosting to the nonprofit organizations. Other generous sponsors - TechSmith, The Sophic Group, and Telerik - provided funding and giveaways for the event. Finally, Microsoft sponsored some of the food in addition to software and book giveaways. Brian Prince, Jeff Blankenburg, Diane Curtis, and Sam Henry from Microsoft all stopped by throughout the weekend.
Congratulations on another amazing Give Camp! These developers truly do make a difference.
Pictures 
Sarah Dutkiewicz
Brian Jackett
Carey Payette
Link to other blog posts on the event:
James Bender
Kenny Drobnack
Sarah Dutkiewicz
Joel Helbling
Carey Payette
Jeremiah Peschka
Craig Stuntz
Last weekend was another powerful, moving experience at the second Give Camp in Ann Arbor. I blogged from the event on Friday and mentioned some of the cool new things at this year's Give Camp (showers, a popup camper, a source control server, and live streaming), but that doesn't even begin to summarize the event. Patrick Steele put together a fabulous video that gives you the flavor of a Give Camp:
Just under 60 developers and designers volunteered onsite in Ann Arbor, plus an additional 12 people volunteered remotely from Knoxville, TN. The Knoxville satellite was led by Nathan Blevins, and that fabulous team of people served 2 nonprofits by themselves! In addition, the Columbus Give Camp was held the same weekend; I'll post separately about them. There was a wonderful sense of community between the three camps, aided by Twitter and the webcams, which kept us in constant contact.
Although there were fewer developer volunteers this year, they were able to help more nonprofits! Give Camp did more with less, like everyone else in this economy. The volunteers helped 18 nonprofit organizations to create websites and applications. I was incredibly impressed with our nonprofits this year; the majority of them were present throughout the weekend, checking in regularly or working beside the volunteers. As a result, they were happier with the results. The nonprofits that participated this year are:
- All About Animals Rescue
- Closer to Home Animal Advocates
- Community & Home Supports
- Eisenhower Dance Ensemble
- Great Sauk Trail Council, Boy Scouts of America
- Interfaith Hospitality Network at Alpha House
- Latino Family Services
- Legacy Land Conservancy
- Lend A Helping Hand
- Leslie Science and Nature Center
- Motivity
- Paula Ratchford Ministries
- People’s IALAC Community Center
- Resource Genesee
- Sisters of Mary
- Southeast Michigan Regional Energy Office
- Starting Over Airedale Rescue
- Workplace Research Foundation
We sorely needed designers again this year, but one amazing designer (the great Ken Arbogast-Wilson) went from project to project helping out, and created some truly beautiful sites.
We also had people fly in for the Give Camp! Barry Stahl wanted to throw a Give Camp in his hometown of Phoenix, Arizona, and flew all the way to Michigan to experience one. We also had great support from Verio, who sent us the fabulous Matt Lagrotte from Florida to make sure that their free hosting (for 6 months) was set up properly.
Thanks to the amazing sponsors: Domino's Pizza (who provided not one but two dinners for us: their new American Legends line of pizzas and oven-baked sandwiches...yum yum!), Washtenaw Community College, Microsoft, Verio, TechSmith, SRT Solutions, Devexpress, Telerik, O'Reilly, Wrox, H&H Consulting, Zen, Red Gate, Bottle Docker, Balsamiq, Dunkin' Donuts, Meijer, and Jet Brains.
Washtenaw Community College was amazingly accommodating again and is already booked for next year! We will be in a different building on campus, a wide-open space in the same place as the showers. Save the date: July 16-18, 2010 is Michigan Give Camp in Ann Arbor 2010!
Pictures:
Nathan Blevins - Knoxville satellite
David Giard
Jason Follas
Patrick Steele
Patrick Steele - Day 1
Patrick Steele - Day 2
Patrick Steele - Day 3
Links to other blog posts on the event (if I missed yours, please let me know and I will add):
Nathan Blevins
John Burns
Bob Karaban
Michael Luttenberger
Chris Roland
Patrick Steele
Aaron Worsham Washtenaw Community College

Today, we kicked off simultaneous Give Camps in Ann Arbor, Columbus, and Knoxville! I'm at the Ann Arbor camp. At this location, here is the breakdown of technologies used on our 16 projects for nonprofit organizations.
- DotNetNuke - 5
- ASP.NET - 2
- WinForms - 1
- Joomla - 6
- WordPress - 1
- Ruby - 1
There are 55 developer volunteers here in Ann Arbor, plus staff and some charity representatives.
There are a lot of positive improvements at the Ann Arbor Give Camp this year. First of all, we have access to showers! This is especially nice for people who travel in for the camp and live too far away to go home at night. Secondly, Josh Holmes brought a popup camper, with running water, a stove, and room to sleep 5 people. Third, we have a source control server set up for the developers. Finally, we have webcams set up in all three locations! Watch our fun this weekend, streaming live:
Ann Arbor: http://www.ustream.tv/channel/aagivecamp
Columbus: http://www.ustream.tv/channel/columbusgivecamp
Knoxville: http://www.ustream.tv/channel/knoxgivecamp
You can also follow MichGiveCamp on Twitter for updates from the Ann Arbor Give Camp. OK - I'm off to put drinks on ice so they're cold for tomorrow!
Everyone has been waiting for this for a long time (if I had a dime every time I was asked the pricing model for Azure, I'd be rich), and here it is...the pricing for Azure has been announced!
For Windows Azure specifically, here is the skinny: compute time is $0.12/hour, storage is $0.15/GB/month stored, storage transactions are $0.01/10K, and bandwidth is $0.10 in/$0.15 out/GB.
For full details including information on service-level agreements, see http://blogs.msdn.com/windowsazure/archive/2009/07/14/confirming-commercial-availability-and-announcing-business-model.aspx.
Those of you who know me well have probably heard me gush about Give Camps at one time or another. If you haven't, take a minute and read last year's Ann Arbor Give Camp writeup or Lansing's Give Camp summary. In those posts, I link to a bunch of other people's posts on the events - read them too. Yes, it was truly that amazing.
What is a Give Camp?
“The single best community event I have ever attended. Sorry, Days of .NET. Sorry, VS Live, SD, Tech Ed, MVP Summit. Great events, all, but not the same. There's just something different about all working together under a deadline.”
- From Martin Shoemaker’s blog
“A technical tsunami of goodwill”
- Pam Smith of the Child Care Network, one of the charities that benefited from Ann Arbor Give Camp 2008
A Give Camp is a group of developers coming together for a weekend to write code for charity. During the Give Camp, developers are welcome to go home in the evenings or camp out all weekend long! There will be food and drinks provided at the event. There will also be XBOXs set up for when you need a little break. It is a lot of fun, for a great cause!
At the Give Camp, there is an expectation of “What Happens at Give Camp, Stays at Give Camp”. Therefore, all source code must be turned over to the charities at the end of the weekend (developers cannot ask for payment) and the charities are responsible for maintaining the code moving forward (charities cannot expect the developers to maintain the codebase).
It truly is a very rewarding experience, and Give Camps have sprung up all over the area. In addition to last year's Ann Arbor Give Camp, Lansing did one in April, and Grand Rapids may do one in October.
Now, there are not one but two Give Camps coming up soon! Register at the links below:
Michigan Give Camp in Ann Arbor: http://michigangivecamp.org/cms/annarbor/ (Register here)
Columbus Give Camp: http://www.columbusgivecamp.org (Register here)
Early registration really helps us, as we are deciding the number of charities we can help by the number of developers that are interested. Hope to see you there!
There is some truly amazing support for parallel programming in .NET 4.0. One of the compelling new features of the Thread Pool in .NET 4.0 is work-stealing, which allows work to be processed by worker threads more efficiently.
First of all, in addition to the global queue, there are local queues for each worker thread.
Let's say that the main program thread generated 2 tasks, which are added to the global queue.
Then each worker thread can take a task to process.
Then, suppose that Task 2 spawns three subtasks: Task 3, Task 4, and Task 5. These tasks are placed on the local queue of Worker Thread 1.
Next, assume Worker Thread 1 completes Task 2. It looks at its local queue, and takes the last task (Task 5) off to process. It purposefully takes the last task, the point being that the last task might still be in the cache, while it is likely that the first task (Task 3) is out of the cache. Hence, there are performance improvements in processing local queues in a LIFO order.
Now, assume Worker Thread p completes Task 1. It looks first at its local queue, and there are no tasks there. Then it looks at the global queue...no tasks there either. Finally, it looks at other local queues. This is the concept of work-stealing: it can "steal" tasks from those queues. So Worker Thread p would take Task 3 to process.
Note also that it steals work from the top of the queue (taking the first in), while Worker Thread 1 is processing from the bottom of the queue (taking the last in). That is to reduce contention. It also optimizes for caching: Worker Thread 1 is taking the tasks that are likely still in its cache, and Worker Thread p is taking the tasks that are least likely to be in Worker Thread 1's cache.
Finally, if Task 3 had further subtasks, they would be placed on Worker Thread p's local queue.
To learn more about the support for parallel programming in .NET 4.0, check out Daniel Moth's talk from PDC 2008 at http://channel9.msdn.com/pdc2008/TL26/. It was one of my top 2 favorite talks from PDC last year...Daniel is an amazing presenter and the functionality is just so cool.
Other Resources on Work-Stealing Queues:
http://www.danielmoth.com/Blog/2008/11/new-and-improved-clr-4-thread-pool.html
http://www.bluebytesoftware.com/blog/2008/08/12/BuildingACustomThreadPoolSeriesPart2AWorkStealingQueue.aspx
nPlus1.org is hosting its fourth Architecture Summit on July 31st at the Microsoft office in Southfield, MI. The topic of this summit will be Patterns and Principles.
Session One: Software Patterns
Patterns are an important tool to use as architects and developers. They provide a common vocabulary for us to design with, as well as a common approach to a common problem. Come learn about useful patterns, and how to use them in your everyday code.
Session Two: How I Learned To Love Dependency Injection
Dependency Injection is one of those scary topics that most developers avoid. It sounds all ‘high-falootin’ and complex. It’s not. Really. We wouldn’t lie. It’s a great way to manage complexity in your system, and a great way to make your system so much more testable. And isn’t that what we all want?
Each session will be followed by open discussions periods. A catered lunch will be provided starting at noon when the welcome time begins.
Register at https://www.clicktoattend.com/invitation.aspx?code=139245.
About nPlus1.org
nPlus1.org is a site dedicated to helping Architects, aspiring Architects and Lead Developers learn, connect and contribute. At nplu1.org you have access to great first party content written by some of the most skilled and experienced Architects working today. You also have access to a nexus of content from around the Internet aimed at keeping Architects up to date on all the new developments in their fields of interest.
In version 4.0 of the .NET Framework, there is a lot of support for parallel programming. One cool class to know is System.Threading.Parallel, which contains a number of static methods to parallelize loops and regions.
Consider this code which uses a for loop:
static void ComputePerfectSquares1()
{
Int64[] perfectSquares = new Int64[arraySize];
for (int i = 0; i < arraySize; i++)
{
perfectSquares[i] = i * i;
Thread.SpinWait(waitTime); // Pretending this is more computationally difficult
}
}
This is a simple example that calculates perfect squares. Because that is a relatively cheap operation, I've also added a Thread.SpinWait to simulate a more computationally expensive action.
Now, I'll write a second method which uses the new Parallel.For. This is one of the static methods on the Parallel class.
static void ComputePerfectSquares2()
{
Int64[] perfectSquares = new Int64[arraySize];
Parallel.For(0, arraySize, i =>
{
perfectSquares[i] = i * i;
Thread.SpinWait(waitTime); // Pretending this is more computationally difficult
});
}
The arguments of the parallel for are very similar to the information we provided to the original for. The first argument is the start index (inclusive) and the second argument is the end index (exclusive). I passed in 0 and arraySize, respectively. Then the third argument is the body to be invoked on each iteration; I'm using a lambda expression to do this. There are also some optional parameters with other method overloads.
Next, I wrote some code to test the relative performance of these methods:
static void Main(string[] args)
{
DateTime startTime;
TimeSpan duration;
// Run using original for
startTime = DateTime.Now;
ComputePerfectSquares1();
duration = DateTime.Now - startTime;
Console.WriteLine("Original for: " + duration.TotalMilliseconds + " ms");
// Run using parallel for
startTime = DateTime.Now;
ComputePerfectSquares2();
duration = DateTime.Now - startTime;
Console.WriteLine("Parallel for: " + duration.TotalMilliseconds + " ms");
// Pause so output can be read.
Console.Read();
}
If I run this code (with arraySize = 1000 and waitTime = 5000000), here are my results:
Running in parallel has cut my processing time down by roughly half (which makes sense since my machine has two cores), from 25.5 seconds to 13.5 seconds. Fabulous!
However, note that if I remove the "Thread.SpinWait" and run again, the original for loop performs better than the parallel for loop:
This is because there is some overhead to using the parallel version. The lesson here: don't parallelize all of your work blindly, but measure performance, find out where the computationally-expensive bottlenecks are and if they can be broken down into smaller chunks that can be run in parallel, and then use this functionality there. The Parallel class is a wonderful resource, giving you an easy way to run a for loop (and other programming constructs) in parallel.
For reference, I've attached the entirety of my program. Note that I did do some refactoring from the code above (which contains a lot of duplication), but I thought it was easier to understand if I inlined in the examples above.
Attachment(s): ParallelConsoleApp.zip