[concurrency-interest] [CPU Affinity] ThreadPoolExecutor to improve"O.S Scheduler" ?

R Samuel Klatchko rsk at moocat.org
Fri Nov 20 14:45:42 EST 2009


Does this only happen with Java or does it happen with other processes as
well?

Try running multiple copies of some other long lived process and see if they
are all running on a single processor.  If they are, you are running into an
issue with the OS (most likely a configuration limiting your user to a
single processor).

samuel



On Fri, Nov 20, 2009 at 11:35 AM, Safe P. <z8sbk at yahoo.com.ar> wrote:

> David, thank you for your answer.
>
> The problem is exactly this:
>
> when I run  java -cp . MyProcess & java -cp .MyProcess & ... in a 12-core
> machine that runs HP-UX, all processes are assign to one processor.
>
> That means that an instance must wait until the end of the previous
> instance to start. I want to run all instances in parallel, using all 12
> processors. Is this possibly? Maybe using ThreadPoolExecutor to execute each
> instance of this "java -cp .."?
>
> Thank you very much in advance!
>
>
> --- El *jue 19-nov-09, David Holmes <davidcholmes at aapt.net.au>* escribió:
>
>
> De: David Holmes <davidcholmes at aapt.net.au>
> Asunto: RE: [concurrency-interest] [CPU Affinity] ThreadPoolExecutor to
> improve"O.S Scheduler" ?
> Para: "Safe P." <z8sbk at yahoo.com.ar>, concurrency-interest at cs.oswego.edu
> Fecha: jueves, 19 de noviembre de 2009, 9:45 pm
>
> Matias,
>
> I'm not really understanding your problem/issue, but most systems have some
> notion of processing domains that let you allocate resources (memory and
> CPU) to a domain and then run specific processes in specific domains. On
> Solaris this is done with processor sets, while on Linux there are CPU-sets.
> I don't know what HP-UX has.
>
> There are no Java API's to control thread or process affinity (other than
> by exec'ing OS utilities to do it, or calling your own native code routines.
>
> Normally, absent any domains, all processes (and all their threads) can run
> on any available processor/core.
>
> HTH.
>
> David Holmes
>
> -----Original Message-----
> *From:* concurrency-interest-bounces at cs.oswego.edu [mailto:
> concurrency-interest-bounces at cs.oswego.edu]*On Behalf Of *Safe P.
> *Sent:* Friday, 20 November 2009 9:35 AM
> *To:* concurrency-interest at cs.oswego.edu
> *Subject:* [concurrency-interest] [CPU Affinity] ThreadPoolExecutor to
> improve"O.S Scheduler" ?
>
>   Hi,
> I'm very new to concurrent programming and I couldn't find anywhere if this
> is an issue or just a limitation.
>
> I'm running several instances of a java process like "process.sh &
> process.sh & process.sh ..." in an HP-UX that runs over a 12-core machine.
>
> When I use sar, top, and other utilities I can see that HP-UX is using just
> 1 core. It doesn't manage to assign one processor per process.
>
> Can I get this using ThreadPoolExecutor (like one System.Runtime.exec() per
> thread)?
>
> Unfortunately, this machine is a production server so I can't get access to
> it in order to do some test and verify that, and of course, if this make a
> significant time improvement.
>
> Thank you very much in advanced.
> --Matias
>
> ------------------------------
>
> Encontra las mejores recetas con Yahoo! Cocina.
> http://ar.mujer.yahoo.com/cocina/
>
>
> ------------------------------
>
> Encontra las mejores recetas con Yahoo! Cocina.
> http://ar.mujer.yahoo.com/cocina/
>
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20091120/8128d541/attachment-0001.html>


More information about the Concurrency-interest mailing list