Skip to main content

Parallel Programming Development

4 replies [Last post]
smartinumcp
Offline
Joined: 2004-09-07

Threading in Java definitely let us take a leap in threading programs. However it's still a hassle to write threading code especially for small algorithms. Like memory management of old, 30-50% becomes thread management, not the actual operations.

Ex:
Iterating through a list I want to perform operations on each item in the list. I don't care what order it happens just that it happens quickly.

Another is the simple case of populating items into a bean in servlet such as struts. It doesn't matter what order the setters are called, just that all are.

If the run-time could speed these operations up with parallel runs that would really let us use this as a common language feature, not done by hand.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robilad
Offline
Joined: 2004-05-05

That has been done with a Kaffe fork already[1], with pretty good results (up to 4x improvements) for floating point applications. See http://www-hydra.stanford.edu/publications/micro2003.pdf for details.

cheers,
dalibor topic

[1] Many exciting things were done with forks of Kaffe. It's a great research platform.

myaneel
Offline
Joined: 2004-01-24

What i've found in small algorithms is that the cost of implementing parallism has negative effect on it's implementation as well as it's execution time. A thread creation takes about 18 to 21 milliseconds in (p4-256: Average) computer. Surely i wish to see support for things like this.

out.write(largeData);@parallel ;

What about Using AOP in these cases ?

jwenting
Offline
Joined: 2003-12-02

Again, how would the runtime (or the compiler) know how to implement that?
How would it ever know your intentions, what parts are to be kept together and what not?

Everything has a cost, and running something as parallel processes is no exception.
Just saving yourself a few lines of code by changing the syntax to something far more obscure doesn't change that, the JVM would still have to create and execute those threads for you but now you loose all control over them.

Better for you to learn how to write multithreaded programs more efficiently and when not to resort to multithreading.

linuxhippy
Offline
Joined: 2004-01-07

And where should the jvm know what can be done in paralell and what not.
Java's threading implementation is the best and cleanest I've seen, and everything which should be paralell should be implemented paralell by you, e.g. making setter/getters paralell wouldn't accelerate your application at all.

You're right it would be cool, but can't be done for technical reasons.
I also would like to have a PC with several TMips ;-)