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


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

Tools/frameworks for Java multi-core programming?

Started byanthonycwmak@gmail.com
First post2012-08-13 22:48 -0700
Last post2012-08-19 19:38 -0400
Articles 16 — 8 participants

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


Contents

  Tools/frameworks for Java multi-core programming? anthonycwmak@gmail.com - 2012-08-13 22:48 -0700
    Re: Tools/frameworks for Java multi-core programming? mr.amitghuge1@gmail.com - 2012-08-14 11:22 -0700
      Re: Tools/frameworks for Java multi-core programming? Arne Vajhøj <arne@vajhoej.dk> - 2012-08-19 19:33 -0400
        Re: Tools/frameworks for Java multi-core programming? anthonycwmak@gmail.com - 2012-08-19 22:05 -0700
          Re: Tools/frameworks for Java multi-core programming? Lew <noone@lewscanon.com> - 2012-08-20 07:26 -0700
            Re: Tools/frameworks for Java multi-core programming? Martin Gregorie <martin@address-in-sig.invalid> - 2012-08-20 19:48 +0000
              Re: Tools/frameworks for Java multi-core programming? Martin Gregorie <martin@address-in-sig.invalid> - 2012-08-20 20:07 +0000
              Re: Tools/frameworks for Java multi-core programming? Lew <lewbloch@gmail.com> - 2012-08-20 14:01 -0700
                Re: Tools/frameworks for Java multi-core programming? Martin Gregorie <martin@address-in-sig.invalid> - 2012-08-20 21:51 +0000
    Re: Tools/frameworks for Java multi-core programming? Robert Klemme <shortcutter@googlemail.com> - 2012-08-14 20:47 +0200
      Re: Tools/frameworks for Java multi-core programming? Lew <lewbloch@gmail.com> - 2012-08-14 15:16 -0700
      Re: Tools/frameworks for Java multi-core programming? anthonycwmak@gmail.com - 2012-08-15 18:50 -0700
        Re: Tools/frameworks for Java multi-core programming? markspace <-@.> - 2012-08-15 21:05 -0700
          Re: Tools/frameworks for Java multi-core programming? anthonycwmak@gmail.com - 2012-08-16 00:10 -0700
            Re: Tools/frameworks for Java multi-core programming? Arne Vajhøj <arne@vajhoej.dk> - 2012-08-17 22:24 -0400
        Re: Tools/frameworks for Java multi-core programming? Arne Vajhøj <arne@vajhoej.dk> - 2012-08-19 19:38 -0400

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

Fromanthonycwmak@gmail.com
Date2012-08-13 22:48 -0700
SubjectTools/frameworks for Java multi-core programming?
Message-ID<62479d2e-e766-433e-9d80-1589ab38fbc1@googlegroups.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

[toc] | [next] | [standalone]


#17876

Frommr.amitghuge1@gmail.com
Date2012-08-14 11:22 -0700
Message-ID<f15d73c2-8e42-42db-b126-eebe0908f110@googlegroups.com>
In reply to#17875
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

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


#18153

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-08-19 19:33 -0400
Message-ID<503177d7$0$284$14726298@news.sunsite.dk>
In reply to#17876
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

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


#18163

Fromanthonycwmak@gmail.com
Date2012-08-19 22:05 -0700
Message-ID<43d72faa-825b-462d-b44f-2800ef9ac00b@googlegroups.com>
In reply to#18153
> 
> > 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

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


#18176

FromLew <noone@lewscanon.com>
Date2012-08-20 07:26 -0700
Message-ID<k0thei$ff4$1@news.albasani.net>
In reply to#18163
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

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


#18249

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-08-20 19:48 +0000
Message-ID<k0u4as$cr1$1@localhost.localdomain>
In reply to#18176
On Mon, 20 Aug 2012 07:26:38 -0700, Lew wrote:

> 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.
>
Not necessarily.

I'm reading my ISP's NNTP server with the Pan newsreader and I'm seeing 
the duplicates, though they're easy to recognise since Pan shows repeated 
To and From: header pairs in front of the message text.

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

- what evidence is there that this is really a 'bot and not some bug in
  an inadequately tested server, possibly in Google Groups.

  I didn't see it before I went on holiday on the 25th of July but it was
  doing its thing when I got back online on the 18th of August.

- I follow a few newsgroups but this is the only one that is showing this
  odd duplication bug. 


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


#18252

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-08-20 20:07 +0000
Message-ID<k0u5en$cr1$2@localhost.localdomain>
In reply to#18249
On Mon, 20 Aug 2012 19:48:44 +0000, Martin Gregorie wrote:

> On Mon, 20 Aug 2012 07:26:38 -0700, Lew wrote:
> 
>> 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.
>>
> Not necessarily.
> 
> I'm reading my ISP's NNTP server with the Pan newsreader and I'm seeing
> the duplicates, though they're easy to recognise since Pan shows
> repeated To and From: header pairs in front of the message text.
> 
> 
>> Someone is spamming the cljp newsgroup via some sort of bot that
>> duplicates old messages.
>>
> Two thoughts:
> 
> - what evidence is there that this is really a 'bot and not some bug in
>   an inadequately tested server, possibly in Google Groups.
> 
>   I didn't see it before I went on holiday on the 25th of July but it
>   was doing its thing when I got back online on the 18th of August.
> 
> - I follow a few newsgroups but this is the only one that is showing
> this
>   odd duplication bug.

I think I've found the source: every duplicate message I've looked at in 
any detail has duplicated trailers in the message text: the number of 
these trailers matches the number of leading To:/From: pairs and all have 
this form:

--- 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


Does anybody know anything about synchro.net? The domain is registered to:
   Rob Swindell
   330 Latigo Ct.
   Norco Hills, California 92860
   United States

I've emailed him about this.

-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


#18255

FromLew <lewbloch@gmail.com>
Date2012-08-20 14:01 -0700
Message-ID<e0162edd-7b25-4fac-a472-1d8f3ed623b2@googlegroups.com>
In reply to#18249
Martin Gregorie wrote:
> Lew wrote:
>> anthonycwmak... wrote:
. . . 
>>> Also, for some reason this threads seem to have a lot of repeated
>>> postings.
>> 
>> You must be using Google Groups.
> 
> Not necessarily.
> 
> I'm reading my ISP's NNTP server with the Pan newsreader and I'm seeing 
> the duplicates, though they're easy to recognise since Pan shows repeated 
> To and From: header pairs in front of the message text.

>> Someone is spamming the cljp newsgroup via some sort of bot that
>> duplicates old messages.
> 
> Two thoughts: 
>
> - what evidence is there that this is really a 'bot and not some bug in
>   an inadequately tested server, possibly in Google Groups.

There were some posts at around the time this all started announcing the 
"new service" and someone else mentioning the infamous NewsMaestro 
spamware.

>   I didn't see it before I went on holiday on the 25th of July but it was
>   doing its thing when I got back online on the 18th of August.
> 
> - I follow a few newsgroups but this is the only one that is showing this
>   odd duplication bug. 

That's evidence of malice-aforethought 'ware.

If the other hints are relevant, that is.

-- 
Lew

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


#18256

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2012-08-20 21:51 +0000
Message-ID<k0ubhf$f4i$2@localhost.localdomain>
In reply to#18255
On Mon, 20 Aug 2012 14:01:52 -0700, Lew wrote:

> Martin Gregorie wrote:
>> Lew wrote:
>>> anthonycwmak... wrote:
> . . .
>>>> Also, for some reason this threads seem to have a lot of repeated
>>>> postings.
>>> 
>>> You must be using Google Groups.
>> 
>> Not necessarily.
>> 
>> I'm reading my ISP's NNTP server with the Pan newsreader and I'm seeing
>> the duplicates, though they're easy to recognise since Pan shows
>> repeated To and From: header pairs in front of the message text.
> 
>>> Someone is spamming the cljp newsgroup via some sort of bot that
>>> duplicates old messages.
>> 
>> Two thoughts:
>>
>> - what evidence is there that this is really a 'bot and not some bug in
>>   an inadequately tested server, possibly in Google Groups.
> 
> There were some posts at around the time this all started announcing the
> "new service" and someone else mentioning the infamous NewsMaestro
> spamware.
> 
>>   I didn't see it before I went on holiday on the 25th of July but it
>>   was doing its thing when I got back online on the 18th of August.
>> 
>> - I follow a few newsgroups but this is the only one that is showing
>> this
>>   odd duplication bug.
> 
> That's evidence of malice-aforethought 'ware.
> 
> If the other hints are relevant, that is.

In support of that, the e-mail address used in the domain's whois is 
rejected. However, as the registrar is GoDaddy, I suspect that would not 
be considered unusual.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

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


#17877

FromRobert Klemme <shortcutter@googlemail.com>
Date2012-08-14 20:47 +0200
Message-ID<a8vkqsF35mU1@mid.individual.net>
In reply to#17875
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/

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


#17884

FromLew <lewbloch@gmail.com>
Date2012-08-14 15:16 -0700
Message-ID<d395c754-ed9e-40fa-b889-3903ecce1d1c@googlegroups.com>
In reply to#17877
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

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


#17919

Fromanthonycwmak@gmail.com
Date2012-08-15 18:50 -0700
Message-ID<b2b68c08-aa7f-4782-b8d8-ff75696c53aa@googlegroups.com>
In reply to#17877
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



 

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


#17920

Frommarkspace <-@.>
Date2012-08-15 21:05 -0700
Message-ID<k0hrib$mej$1@dont-email.me>
In reply to#17919
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>

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


#17921

Fromanthonycwmak@gmail.com
Date2012-08-16 00:10 -0700
Message-ID<e5dc4599-93c2-4dbd-a836-a2d843c19921@googlegroups.com>
In reply to#17920
Thanks about the ForkJoin, Mark. Most interesting read! (Even though in some enviroments I still have to use Java 1.6!)

Anthony

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


#17977

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-08-17 22:24 -0400
Message-ID<502efcd3$0$284$14726298@news.sunsite.dk>
In reply to#17921
On 8/16/2012 3:10 AM, anthonycwmak@gmail.com 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

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


#18154

FromArne Vajhøj <arne@vajhoej.dk>
Date2012-08-19 19:38 -0400
Message-ID<50317908$0$284$14726298@news.sunsite.dk>
In reply to#17919
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

[toc] | [prev] | [standalone]


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


csiph-web