Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tools/frameworks for Java multi-core programming?

Reply
Thread Tools

Tools/frameworks for Java multi-core programming?

 
 
anthonycwmak@gmail.com
Guest
Posts: n/a
 
      08-14-2012
I am trying to find tools/frameworks that help with writing Java program that can utilize multi-core CPU. So far I only found jconcurr, JOMP, JAMP, Ateji, but they all either requires special shell command to compile and run the programs, or, in Ateji's case use a special file extension which is converted to java file. This doesn't seem to be ideal if I require to build multi-core programs that can be built on Maven or similar, and requires them to run on an enterprise environment or application server.

Besides writing concurrent programs, by using Java Concurrency API directly, to utilize the multi-core, are there other easier/simpler way to create Java enterprise applications that utlize multi-core CPUs? Preferably, just annotate my POJOs to make them multi-core capable?

Kind Regards,
Anthony Mak
 
Reply With Quote
 
 
 
 
mr.amitghuge1@gmail.com
Guest
Posts: n/a
 
      08-14-2012
http://tutorialswithexamples.com/cat...-logging-apis/


On Tuesday, August 14, 2012 11:18:10 AM UTC+5:30, (E-Mail Removed) wrote:
> I am trying to find tools/frameworks that help with writing Java program that can utilize multi-core CPU. So far I only found jconcurr, JOMP, JAMP, Ateji, but they all either requires special shell command to compile and run the programs, or, in Ateji's case use a special file extension which is converted to java file. This doesn't seem to be ideal if I require to build multi-core programs that can be built on Maven or similar, and requires them to run on an enterprise environment or application server.
>
>
>
> Besides writing concurrent programs, by using Java Concurrency API directly, to utilize the multi-core, are there other easier/simpler way to createJava enterprise applications that utlize multi-core CPUs? Preferably, justannotate my POJOs to make them multi-core capable?
>
>
>
> Kind Regards,
>
> Anthony Mak

 
Reply With Quote
 
 
 
 
Robert Klemme
Guest
Posts: n/a
 
      08-14-2012
On 14.08.2012 07:48, http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I am trying to find tools/frameworks that help with writing Java
> program that can utilize multi-core CPU. So far I only found
> jconcurr, JOMP, JAMP, Ateji, but they all either requires special
> shell command to compile and run the programs, or, in Ateji's case
> use a special file extension which is converted to java file. This
> doesn't seem to be ideal if I require to build multi-core programs
> that can be built on Maven or similar,


Why is that an issue? Typically you can include custom build procedures
in a build tool / framework.

> and requires them to run on an
> enterprise environment or application server.


If you are on an JEE application server that will usually take care of
the concurrency. You typically need to use those APIs the JEE spec or
AS at hand provides to not interfere with the framework in bad ways
(e.g. by breaking transactions). That does not seem like a bad option
although AS come with their own learning curve.

> Besides writing concurrent programs, by using Java Concurrency API
> directly, to utilize the multi-core, are there other easier/simpler
> way to create Java enterprise applications that utlize multi-core
> CPUs? Preferably, just annotate my POJOs to make them multi-core
> capable?


"Making a POJO multi-core capable" is meaningless. Using concurrency is
more like an architectural property of your application (even though you
need to take care to use POJOs properly - but it's not enough to make
POJOs thread safe). At this point I am suspecting that someone told you
modern Java programs must use multiple cores and you want to get it done
easily. Unfortunately that won't work: you need to understand the
particular issues associated with concurrency to properly craft such
applications - even if you use a framework that takes away a large part
of the work from you.

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      08-14-2012
Robert Klemme wrote:
> anthonycwmak wrote:
>> I am trying to find tools/frameworks that help with writing Java
>> program that can utilize multi-core CPU. So far I only found


Java programs can "utilize" multi-core CPUs out of the box.
You need do nothing special.

>> jconcurr, JOMP, JAMP, Ateji, but they all either requires special
>> shell command to compile and run the programs, or, in Ateji's case
>> use a special file extension which is converted to java file. This
>> doesn't seem to be ideal if I require to build multi-core programs
>> that can be built on Maven or similar,


> Why is that an issue? Typically you can include custom build procedures
> in a build tool / framework.


>> and requires them to run on an
>> enterprise environment or application server.


> If you are on an JEE application server that will usually take care of
> the concurrency. You typically need to use those APIs the JEE spec or
> AS at hand provides to not interfere with the framework in bad ways
> (e.g. by breaking transactions). That does not seem like a bad option
> although AS come with their own learning curve.


>> Besides writing concurrent programs, by using Java Concurrency API
>> directly, to utilize the multi-core, are there other easier/simpler
>> way to create Java enterprise applications that utlize multi-core
>> CPUs? Preferably, just annotate my POJOs to make them multi-core
>> capable?


> "Making a POJO multi-core capable" is meaningless. Using concurrency is
> more like an architectural property of your application (even though you
> need to take care to use POJOs properly - but it's not enough to make
> POJOs thread safe). At this point I am suspecting that someone told you
> modern Java programs must use multiple cores and you want to get it done
> easily. Unfortunately that won't work: you need to understand the
> particular issues associated with concurrency to properly craft such
> applications - even if you use a framework that takes away a large part
> of the work from you.


As Robert said, if you're writing enterprise apps using Java EE, then the
threading is already done. You should pretty much never explicitly code
a Java EE component to spawn a thread.

Java SE is another matter. You do have to use thread calls to spawn threads.
Once you have at least two threads in a program (and all Java programs do),
then you are multi-core capable.

Java programs that use threads are already multi-core capable.

Boom, done.

What are you really after?

--
Lew
 
Reply With Quote
 
anthonycwmak@gmail.com
Guest
Posts: n/a
 
      08-16-2012
hi Robert, Lew,

Thanks you guys for reminding me about not to spawn threads on JEE applications directly. I should look into perhaps using EJB Timer and other ways toimplement concurrency properly in enterprise app.

I am interested Loop Parallelization (and Tash Parallelization, Pipeline Paralleization etc) as supported by tools such as jconqurr etc. Which could be useful for scientific applications and matrix operations. (I looked into divide and conquer approaches like MapReduce as well.) But I like the idea like jconqurr and other tools, that I can implement parallelization with just code annotations. At least in those simple case that locking and consistency is not a problem. Thanks for pointing out I can make custom building procedure with a build tool, just that if the parallelization tool/frameworks don't require command line building it is preferable to me.

I am interested in multi-core programming because a while ago there have been some buzz about how to utilize multi-core or even GPU for example for scientific applications. And, I was wondering how to do that in Java. Justcurious.

Anthony




 
Reply With Quote
 
markspace
Guest
Posts: n/a
 
      08-16-2012
On 8/15/2012 6:50 PM, (E-Mail Removed) wrote:

>
> I am interested in multi-core programming because a while ago there
> have been some buzz about how to utilize multi-core or even GPU for
> example for scientific applications. And, I was wondering how to do
> that in Java. Just curious.



Introduction here:

<http://docs.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html>


 
Reply With Quote
 
anthonycwmak@gmail.com
Guest
Posts: n/a
 
      08-16-2012
Thanks about the ForkJoin, Mark. Most interesting read! (Even though in some enviroments I still have to use Java 1.6!)

Anthony
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-18-2012
On 8/16/2012 3:10 AM, (E-Mail Removed) wrote:
> Thanks about the ForkJoin, Mark. Most interesting read! (Even though in some enviroments I still have to use Java 1.6!)


I believe that you can get the 'y' code from here:
http://g.oswego.edu/dl/concurrency-interest/
and make it work on 1.6!

Arne


 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-19-2012
On 8/14/2012 2:22 PM, (E-Mail Removed) wrote:
> On Tuesday, August 14, 2012 11:18:10 AM UTC+5:30, (E-Mail Removed)
> wrote:
>> Besides writing concurrent programs, by using Java Concurrency API
>> directly, to utilize the multi-core, are there other easier/simpler
>> way to create Java enterprise applications that utlize multi-core
>> CPUs? Preferably, just annotate my POJOs to make them multi-core
>> capable?


> http://.../category/java-tutorials/java-logging-apis/


What has logging API's to do with this question??

Arne
 
Reply With Quote
 
Arne Vajh°j
Guest
Posts: n/a
 
      08-19-2012
On 8/15/2012 9:50 PM, (E-Mail Removed) wrote:
> I am interested Loop Parallelization (and Tash Parallelization,
> Pipeline Paralleization etc) as supported by tools such as jconqurr
> etc. Which could be useful for scientific applications and matrix
> operations. (I looked into divide and conquer approaches like
> MapReduce as well.)


markspace has already pointed you to fork join.

> But I like the idea like jconqurr and other
> tools, that I can implement parallelization with just code
> annotations.


Now we are starting to talk about something rather specialized.

Maybe you will need to write something yourself.

> At least in those simple case that locking and
> consistency is not a problem. Thanks for pointing out I can make
> custom building procedure with a build tool, just that if the
> parallelization tool/frameworks don't require command line building
> it is preferable to me.


You can do practically verything from ant and you can call
ant from your IDE.

> I am interested in multi-core programming because a while ago there
> have been some buzz about how to utilize multi-core or even GPU for
> example for scientific applications. And, I was wondering how to do
> that in Java.


Basic thread support has been in Java since version 1.0.

Arne

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot Requirements: 1.Sr Java Developer,2.Java Developer (Java with EJB) Isaac Java 0 01-20-2011 08:41 PM
hey i am just started java,, can anyone tell me the use ,application, why java , importance of java.. manish sahu Java 3 02-14-2008 12:00 AM
[JAVA] [EVALUATION] - The Java Failure (Sorry: The Java(tm) Failure) Ilias Lazaridis Java 0 02-01-2005 10:32 AM
JAVA VIRTUAL MUCHINE OR SUN JAVA Fernando Kohan Firefox 1 11-14-2004 02:04 AM
Job to convert Java App 1.3.1 to Java Newest of Java Michael Kintner Java 0 11-30-2003 04:42 AM



Advertisments