1. Computing & Technology

Discuss in my forum

Dan Mabbutt

Fun and Games With Threading

By , About.com GuideNovember 30, 2011

Follow me on:

Threading is a technique that has an evil reputation because things can happen when you start using it that you just don't understand. But it really isn't all that hard.

A new article about Threading has just been added to the site that explains what it is and how to start using it. To illustrate the article, I used a program that I wrote to find all of the permutations of the elements in an array - mainly because I wanted something that involved a few more execution cycles than most example programs. But you might be interested in that too. The link is in the article.

Since I was investigating threading, I decided to poke into a few darker corners. For example:

  • What would happen if the same sub was executed directly and as a worker thread?
  • Can you adjust the priority of a worker thread to be higher than the thread that started it?
  • How do you pass multiple parameters to a worker thread?

To see the answers: Threading

Comments
January 23, 2012 at 8:23 am
(1) Dev Guy says:

I’m developing an application that consumes Web Services, I’ve been dealing with threading and as you say it performs unexpected things and sometimes locks up. I’m working on finding a way around the problem.

January 23, 2012 at 11:00 am
(2) Dan Mabbutt says:

Yeah, well, that’s the thing about threading. The concepts are actually quite simple, but your program will often do unexpected things. And it’s tough to debug too.

Good Luck! Let us know if you have some great insights to share after you figure it out.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Related Searches fun and games

©2012 About.com. All rights reserved.

A part of The New York Times Company.