Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #17880 > unrolled thread

Tools/frameworks for Java multi-core programming?

Started by"anthonycwmak" <anthonycwmak@1:261/38.remove-fcj-this>
First post2012-08-14 19:59 +0000
Last post2012-08-20 18:58 +0000
Articles 10 — 9 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Tools/frameworks for Java multi-core programming? "anthonycwmak" <anthonycwmak@1:261/38.remove-fcj-this> - 2012-08-14 19:59 +0000
    Re: Tools/frameworks for Java multi-core programming? "mr amitghuge1" <mr.amitghuge1@1:261/38.remove-fcj-this> - 2012-08-14 19:59 +0000
      Re: Tools/frameworks for Java multi-core programming? "Arne Vajhøj" <arne.vajhøj@1:261/38.remove-fzq-this> - 2012-08-20 18:58 +0000
        Re: Tools/frameworks for Java multi-core programming? "anthonycwmak" <anthonycwmak@1:261/38.remove-fzq-this> - 2012-08-20 18:58 +0000
          Re: Tools/frameworks for Java multi-core programming? "Lew" <lew@1:261/38.remove-fzq-this> - 2012-08-20 18:58 +0000
    Re: Tools/frameworks for Java multi-core programming? "Robert Klemme" <robert.klemme@1:261/38.remove-z1z-this> - 2012-08-15 18:36 +0000
      Re: Tools/frameworks for Java multi-core programming? "Lew" <lew@1:261/38.remove-z1z-this> - 2012-08-15 18:36 +0000
      Re: Tools/frameworks for Java multi-core programming? "anthonycwmak" <anthonycwmak@1:261/38.remove-s96-this> - 2012-08-16 19:16 +0000
        Re: Tools/frameworks for Java multi-core programming? "markspace" <markspace@1:261/38.remove-s96-this> - 2012-08-16 19:16 +0000
        Re: Tools/frameworks for Java multi-core programming? "Arne Vajhøj" <arne.vajhøj@1:261/38.remove-fzq-this> - 2012-08-20 18:58 +0000

#17880 — Tools/frameworks for Java multi-core programming?

From"anthonycwmak" <anthonycwmak@1:261/38.remove-fcj-this>
Date2012-08-14 19:59 +0000
SubjectTools/frameworks for Java multi-core programming?
Message-ID<502AA17C.56826.calajapr@time.synchro.net>
From: anthonycwmak@gmail.com

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

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#17881

From"mr amitghuge1" <mr.amitghuge1@1:261/38.remove-fcj-this>
Date2012-08-14 19:59 +0000
Message-ID<502AA17C.56827.calajapr@time.synchro.net>
In reply to#17880
  To: anthonycwmak
From: mr.amitghuge1@gmail.com

http://tutorialswithexamples.com/category/java-tutorials/java-logging-apis/


On Tuesday, August 14, 2012 11:18:10 AM UTC+5:30, anthon...@gmail.com 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 create Java 
enterprise applications that utlize multi-core CPUs? Preferably, just annotate 
my POJOs to make them multi-core capable?
>
>
>
> Kind Regards,
>
> Anthony Mak

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#18229

From"Arne Vajhøj" <arne.vajhøj@1:261/38.remove-fzq-this>
Date2012-08-20 18:58 +0000
Message-ID<50327C3A.57154.calajapr@time.synchro.net>
In reply to#17881
  To: mr amitghuge1
From: Arne Vajhoj <arne@vajhoej.dk>

On 8/14/2012 2:22 PM, mr.amitghuge1@gmail.com wrote:
> On Tuesday, August 14, 2012 11:18:10 AM UTC+5:30, anthon...@gmail.com
> 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

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#18236

From"anthonycwmak" <anthonycwmak@1:261/38.remove-fzq-this>
Date2012-08-20 18:58 +0000
Message-ID<50327C3C.57161.calajapr@time.synchro.net>
In reply to#18229
  To: Arne Vajhøj
From: anthonycwmak@gmail.com

>
> > http://.../category/java-tutorials/java-logging-apis/
>
>
>
> What has logging API's to do with this question??

I was wondering the same.
Also, for some reason this threads seem to have a lot of repeated postings.

Anthony

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#18245

From"Lew" <lew@1:261/38.remove-fzq-this>
Date2012-08-20 18:58 +0000
Message-ID<50327C3E.57170.calajapr@time.synchro.net>
In reply to#18236
  To: anthonycwmak
From: Lew <noone@lewscanon.com>

On 08/19/2012 10:05 PM, anthonycwmak@gmail.com wrote:
>>
>>> http://.../category/java-tutorials/java-logging-apis/
>>
>>
>>
>> What has logging API's to do with this question??
>
> I was wondering the same.
> Also, for some reason this threads seem to have a lot of repeated postings.

You must be using Google Groups.

Someone is spamming the cljp newsgroup via some sort of bot that duplicates old 
messages.

--
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#17891

From"Robert Klemme" <robert.klemme@1:261/38.remove-z1z-this>
Date2012-08-15 18:36 +0000
Message-ID<502BE71F.56838.calajapr@time.synchro.net>
In reply to#17880
  To: anthonycwmak
From: Robert Klemme <shortcutter@googlemail.com>

On 14.08.2012 07:48, anthonycwmak@gmail.com 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/

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#17898

From"Lew" <lew@1:261/38.remove-z1z-this>
Date2012-08-15 18:36 +0000
Message-ID<502BE720.56845.calajapr@time.synchro.net>
In reply to#17891
  To: Robert Klemme
From: Lew <lewbloch@gmail.com>

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

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#17937

From"anthonycwmak" <anthonycwmak@1:261/38.remove-s96-this>
Date2012-08-16 19:16 +0000
Message-ID<502D38C2.56887.calajapr@time.synchro.net>
In reply to#17891
  To: Robert Klemme
From: anthonycwmak@gmail.com

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 to 
implement 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. :) Just 
curious.

Anthony

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#17941

From"markspace" <markspace@1:261/38.remove-s96-this>
Date2012-08-16 19:16 +0000
Message-ID<502D38C2.56888.calajapr@time.synchro.net>
In reply to#17937
  To: anthonycwmak
From: markspace <-@.>

On 8/15/2012 6:50 PM, anthonycwmak@gmail.com 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>

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#18230

From"Arne Vajhøj" <arne.vajhøj@1:261/38.remove-fzq-this>
Date2012-08-20 18:58 +0000
Message-ID<50327C3A.57155.calajapr@time.synchro.net>
In reply to#17937
  To: anthonycwmak
From: Arne Vajhoj <arne@vajhoej.dk>

On 8/15/2012 9:50 PM, anthonycwmak@gmail.com 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

--- BBBS/Li6 v4.10 Dada-1
 * Origin: Prism bbs (1:261/38)
--- Synchronet 3.16a-Win32 NewsLink 1.98
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web