SwingWorker: the importance of being concurrent

So why all this posts about SwingWorker, you ask? Well, because "Concurrency is the next major revolution in how we write software". That's what Herb Sutter says. And Herb Sutter has been one of my favourite gurus since I first met C++ around 1990. Herb kept the C++ FAQ on those years, and posted weekly exercises for those of us suffering C++. (Yeah, I know he works for Microsoft, nobody is perfect ;-) ).

But, of course, it's not only Herb. Our Chief Technology Officer, Greg Papadopoulos is also aware (PDF) of that.

(Yes, we have lots of innovators on board. Congratulations to the Solaris 10 team that has won the InfoWorld's 2005 Innovation Award !!).

Well, the fact is that most Java Virtual Machines may be able to run different Threads on different processors (or on the same processor but on a different core, or on the same processor but on a different chip thread, or both). You don't have to do special stuff to do that. It just happens. You span a Thread and it runs on whatever processor is idle. That easy. The JVM and the Operating System do that for us.

(See an example with a dual G5 system, for instance)

So there comes my fifth suggestion for SwingWorkers:

Swingworker suggestion V: Use SwingWorkers in your Java applications By using SwingWorkers (or any other threading mechanism of your liking) your application will run (much) faster in multi-core systems, multi-processor systems or processors with chip-multithreading (as Intel's hyperthreading) or a combination of those (as Sun's Niagara). Threading is the way to fully exploit future processors.

Or, as Herb says:

"If you haven’t done so already, now is the time to take a hard look at the design of your application, determine what operations are CPU-sensitive now or are likely to become so soon, and identify how those places could benefit from concurrency. Now is also the time for you and your team to grok concurrent programming’s requirements, pitfalls, styles, and idioms." (Herb Sutter)

Happy Threading,
Antonio

Comentarios:

Enviar un comentario:
Los comentarios han sido deshabilitados.
About

swinger

Search

Archives
« abril 2014
lunmarmiéjueviesábdom
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Hoy