Hi,

On Wed, 15 Nov 2006, Carl Cerecke wrote:

> I'm not really taking sides yet. I'll watch and see how it pans out.
Now there is a wise comment.

> 
> (b) Threads are hard.
> 
> Threads make programs hard for programmers to reason about.
> 
> A recent paper in IEEE computer (May 2006) titled "The problenm with
> Threads" says this in the abstract:For concurrent programming to
> become mainstream, we must discard threads as a programming model.
> Nondeterminism should be judiciously and carefully introduced where
> needed, and it should be explicit in programs.
> 
When your program is handling multiple disparate real world events 
(multiple sockets, timers etc) as it communicates with external programs 
on a different computer, things like determinism disappears. Long 
disappears.

Now, when you get computers with multiple cores, and we are seeing more 
computers with mutliple cores, wouldn't it be nice to write code to take 
advantage of the cores? Sun have computers with tens of cores. My current 
desktop has two cores.   

With threads, I can easily take advantage of all the cores the computer 
will give me.

Which brings me back to the key idea: maybe when programmers say they hate 
threads because of context switching issues and not needed, they are 
really saying

 a)don't know about threads, have never been trained on them
 b)hard to debug threads cause gdb etc don't handle threads well
 c)there style of writing code is so messy that threads make it too 
   confusing. 

Interestingly, Sun have a system called openmp, which handles threads 
nicely  - the compiler actually works out the parrallelism. The writer 
gives some guidelines, and the compiler does the rest..


Derek.


-- 
Derek Smithies Ph.D.
IndraNet Technologies Ltd.
Email: [EMAIL PROTECTED]
ph +64 3 365 6485
Web: http://www.indranet-technologies.com/

Reply via email to