views:

133

answers:

4
+1  Q: 

What are threads?

  1. What are threads?
  2. Why do you think I should care about them?
  3. Where would you suggest I go to learn more (I'm working in Delphi, if that matters).

Thanks! -- Al C.

+1  A: 

Threads allow you to utilize multiple processors or cores in a CPU, so they offer tremendous speedups when used properly on specific machines.

samoz
Correct...but fails to differentiate between using multiple threads and multiple processes.
dmckee
+1  A: 

A little history from an "old timer": when I first heard about threads, they were referred to as "threads of control".

One of the earlier popular threading libraries was (and still is) "pthreads" or "POSIX Threads". It was derived from the Concert Multithread Architecture from Digital Equipment Corporation. It's notable that the documentation for pthreads still uses the term "thread of control". From an online man page for pthread_create:

pthread_create creates a new thread of control that executes concurrently with the calling thread.

You should care about threads because everything you do on a computer is done in a thread. Even the simplest "Hello, world" program contains at least a single thread.

Things get more interesting with multiple threads. In fact, they get too interesting if you're not careful!

John Saunders
A: 
  1. The number of 'things' your program/application can do at the same time without being influenced by the other 'things' it is doing at that specific time.
  2. Example supporting 1. Lets say your program is a car, but you are not using threads, while opening the door, the door is stuck and you can't close it. Now you can't start your car because there is only one action available and you can't start any other before the previous is ended. If you would be using threads in your program ( the car ) you would be driving around with an open door ;-)
  3. What a thread is is fairly easy, using it is language dependent so search for the right documentation and just have some fun :)
mhd