wood burning stoves*
The moose likes Threads and Synchronization and the fly likes When is threading appropriate? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "When is threading appropriate?" Watch "When is threading appropriate?" New topic
Author

When is threading appropriate?

Martin Logan
author
Greenhorn

Joined: Nov 04, 2010
Posts: 3
Here are the slides from a talk by John K. Ousterhout done a number of years ago. This thinking influenced me back then and helped my develop an interest in alternate forms of concurrency aside from threading such as the process model found within Erlang. Threads are extremely suitable in a number of cases, that number of cases however, is smaller than many people think. Take a look:

http://home.pacbell.net/ouster/threads.pdf
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Fifteen years later, and it still rings true. I've been reading other opinions lately which say basically "Threading is hard, so let's have the smart people who can handle it properly package it or encapsulate it somehow, so that ordinary programmers can use it without falling into all of those tar pits."

I think there's been some progress in this direction, but not much. I rewrote some of my code just the other day to use classes from the java.util.concurrent package, which simplified it a bit, but the tar pits were still in plain view. I think that whatever threading abstractions the experts come up with are going to be leaky for quite a while yet.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 4167
    
  21

But at the same time, the benefits of multi-threading is increasing as hardware is more capable in support for more simultaneous tasks (multiple cores are the norm now, not the exception. And memory isn't a limitation as much either.) So were-as the problems persist, there is greater potential for benefit and so more demand. I think something major needs to change in Java in this respect...


Steve
Martin Logan
author
Greenhorn

Joined: Nov 04, 2010
Posts: 3
I would say that the benefit lies in the being able express concurrency oriented solutions and to properly exploit the parallelism of new hardware. The threading abstraction, fundamentally the shared memory approach, is what needs to change for the vast majority of cases to truly allow the programming community at large to benefit. With process based concurrency leveraging multicores is well within the reach of any intermediate level programmer. Erlang is a good example of this.

The other nice aspect of getting rid of shared memory is that distribution becomes more simple. The syntax for communicating across machines does not have to change from that used to communicate locally. This is called location transparency and can't be achieved with shared memory, because of course, memory can't be shared over a network, only copied.

Martin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When is threading appropriate?
 
Similar Threads
Fetching Data From ResultSet
SingleThreadModel- when to choose that approach?
Please give me some suggestions about SCJP1.4,I'll take it.
Does "Java Threads" book discuss OS Platform Dependency issue?
Is this thread safe?