Is Threading Going Away?

I attended the Indianapolis .NET Developers Association meeting last night. One of the discussion points was on the parallelism features in .NET. The question that was asked was in regard to these new commands in .NET were based on threads. Programming parallel feature has required creating and using threads. When I heard this question, it made me think back to the late eighties and early nineties and memory management.

Back in the "old days" you had to worry about memory management. In fact, if you needed more than 640k of memory&mdashyes "k" as in 1024 bytes per k-- you had to do special processing with extended or expanded memory on the computer. The processors could only easily work with 640kb of memory and thus complex things were needed to go beyond that. Developer would spend days and weeks tweaking programs to get them to operate in under 640kbs. You had to work with memory, you had to understand extended and expanded concepts, and you had to do lots of low level tweaking.

If you are under the age of 30, you might be scratching your head and wondering what I'm talking about. If you are an old C or C++ programmer, you are likely thinking back to the "old days" where you spent hours chasing memory. The bottom line is that today few developers even think about memory constraints let along about the methods around them. You simply just use memory.

.NET includes the Task Parallel Library, which allows you to take C# code like the following:

// Sequentialforeach (var item in sourceCollection){ Process(item);}

And turn it into parallelized code by changing it to the following:

// Parallel Parallel.ForEach(sourceCollection, item => Process(item));

It also includes the PLINQ features added in .NET 3.0 such as:

var source = Enumerable.Range(1, 10000);var evenNums = from num in source.AsParallel() where Compute(num) > 0 select num;

While this is only a little of the code available, you'll see that there is no reference to threads. The concept of threading is destined to be like the concepts of extended and expanded memory. It is destined to disappear.

As developers, the day is coming when you will likely stop thinking about creating a thread and assigning code to it. Rather, you will likely change your thinking to be about processes that your code performs. You will simply identify process and tasks that can be parallelized and you'll mark them appropriately. Threading--or other underlying technologies-- will be taken care of automatically, and the code within the identified processes will be spread across the cores or processors. The developer won't have to worry about the details.

You won't focus on threads; you'll focus on processes and tasks.

You can already see this change in thinking in what Microsoft has done. You can now run code in parallel by simply adding a few keywords. While the concepts of Extended and Expanded memory didn't disappear overnight, neither will threading. However, it is safe to say the days are numbered that most developers will need to think about the details of threading.

Of course, while you won't have to think about threading, you will have to think about parallelizing or running concurrent code!



Blog Categories

Blog Archives

Comments

  • Posted by Moosefan on 12/14/2011 06:55am

    hi there i'm new about here, i would like to say that this is a superb web site. Look at my website for many revisions on pokies [url=http://playpokiesonlineaustralia.com]casino games[/url]

    Reply
  • Posted by insantito on 12/10/2011 05:18pm

    [url=http://www.e-viagra.com.pl]viagra[/url], hinder my site. If you are interested in beau, see.

    Reply
  • Posted by Moosefan on 12/10/2011 02:45am

    hello i am brand-new all around right here, simply wanted to convey this is a superb internet site. Look at this site for some improvements on pokies [url=http://playpokiesonlineaustralia.com]play pokies[/url]

    Reply
  • Posted by Mooseplayer on 12/10/2011 01:07am

    hello i'm brand-new about here, wanted to state this is an excellent internet site. Have a look at my site for many improvements on pokies [url=http://playpokiesonlineaustralia.com]play pokies[/url]

    Reply
  • Posted by Mooseplayer on 12/09/2011 11:05pm

    hello there im new around right here, wanted to express until this is a superb website. Check out my website for a lot of changes in pokies [url=http://playpokiesonlineaustralia.com]online pokies[/url]

    Reply
  • Posted by Mooseplayer on 12/09/2011 10:57pm

    hi there im brand-new all around here, simply wanted to convey until this is a superb internet site. Have a look at my site for a few revisions on pokies [url=http://playpokiesonlineaustralia.com]pokies online[/url]

    Reply
  • Posted by Mooseplayer on 12/09/2011 12:16pm

    hello there i am new around right here, wanted to say that is a great web site. Check out my website for many updates about pokies [url=http://playpokiesonlineaustralia.com]play pokies[/url]

    Reply
  • Posted by anibleabs on 12/08/2011 09:37am

    Malgre de l' immobilier le site de petites annonces immobilieres qui s'en sort et qui monte tirent sa chandelle du jeu

    Reply
  • Posted by anibleabs on 12/05/2011 03:27pm

    bien que l'on observe une baisse de l' immobilier le site de petites annonces immobilieres qui s'en sort et qui grimpent tirent sa chandelle du jeu

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

Most Popular Programming Stories

More for Developers

RSS Feeds