Using multiple processors and threads

Hi there,
Just a quick question... I am working on an application that is VERY processor intensive. There is no real way to improve this, but I do have access to a multiple processor server.
Can anyone tell me if Java code can be written to utilise more than one processor? I assume due to the VM, that this is unlikely - and that one must resort to the operating system used on the server, where hopefully the VM can be forced to use more than one processor.
If this is not possible - has anyone written applications that run across several VMs? Is this possible, and what is the performance like?
Thanks for any help.
Nick

The Java VM will indeed utilize multiple processors. Just create a seperate thread to do your work and it will schedule it. In fact it's way easier than most languages:
public class MyThreadimplements Runnable {
public MyThread() {
try {
Thread newThread= new Thread(this);
newThread.setPriority(Thread.MIN_PRIORITY); // see other enumerations to boost priority
newThread.start();
} catch(Exception e) {
System.err.println(e);
public void run() {
// do your work here
}

Similar Messages

  • ODI error-THIS CLAUSE USES MULTIPLE CONNECTIONS AND THEREFORE CANNOT BE EXE

    Hi John,
    I have tried loading the smartlist values and the following error is encountered.
    THIS CLAUSE USES MULTIPLE CONNECTIONS AND THEREFORE CANNOT BE EXECUTED ON THE SOURCE

    Hi John,
    I am still facing the some problem.
    I have updated the join with the expression like yours
    then ran the interface
    The exception is as follows
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 26, in ?
    java.sql.SQLException: Table not found: EXCEPTION in statement [select   C1_PERIOD    "Period",C2_ACCOUNT    "Account",C3_ENTITY    "Entity",C4_EMPLOYEE    "Employee",C5_YEAR    "Year",C6_SCENARIO    "Scenario",C7_VERSION    "Version",'Local'    "Currency",'HSP_InputValue'    "HSP_Rates",CASE WHEN C10_ENTRY_ID IS NULL
    THEN C8_DATA
    ELSE C10_ENTRY_ID
    END    "Data" from "C$_1Totplan_WrkforceData"   left outer join "C$_0Totplan_WrkforceData"   ON C8_DATA=C11_NAME
    AND C9_ENUMERATION_ID=
    (SELECT ENUMERATION_ID FROM Exception]
         at org.hsqldb.jdbc.jdbcUtil.sqlException(jdbcUtil.java:67)
         at org.hsqldb.jdbc.jdbcStatement.fetchResult(jdbcStatement.java:1598)
         at org.hsqldb.jdbc.jdbcStatement.executeQuery(jdbcStatement.java:194)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx5.f$0(<string>:26)
         at org.python.pycode._pyx5.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    java.sql.SQLException: java.sql.SQLException: Table not found: EXCEPTION in statement [select   C1_PERIOD    "Period",C2_ACCOUNT    "Account",C3_ENTITY    "Entity",C4_EMPLOYEE    "Employee",C5_YEAR    "Year",C6_SCENARIO    "Scenario",C7_VERSION    "Version",'Local'    "Currency",'HSP_InputValue'    "HSP_Rates",CASE WHEN C10_ENTRY_ID IS NULL
    THEN C8_DATA
    ELSE C10_ENTRY_ID
    END    "Data" from "C$_1Totplan_WrkforceData"   left outer join "C$_0Totplan_WrkforceData"   ON C8_DATA=C11_NAME
    AND C9_ENUMERATION_ID=
    (SELECT ENUMERATION_ID FROM Exception]
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.h.y(h.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Edited by: Sravan Ganti on May 4, 2009 6:07 AM

  • When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    When I open a pdf file, after a few seconds, it hides the toolbar and I don't know how to get it back.  I use multiple monitors and, without being able to grab the toolbar, I am unable to move the pdf file to a different monitor.  How do I stop this?

    Does Firefox switch to full screen if you press F11 ?
    You can also try the F10 key to see if that brings up the menu bar.
    * If the above steps didn't help then see http://kb.mozillazine.org/Corrupt_localstore.rdf
    Note: Do not delete localstore.rdf in the program folder (Windows: "C:\Program Files\Mozilla Firefox\defaults\profile\") (Mac: "/Applications/Firefox.app/defaults/profile/")

  • Help using multiple iphones and ipods on itunes

    Okay, is there any simple way to use multiple apple products thru itunes. I can log in on my account and sync my iphone/ipod, then I log out and log back in with my daughter's account info. I plug her itouch in and it wants to read all of my apps(some apps we both have on our devices). Have problems with music sharing as well. Still a PC user. Get very frustrated with itunes. spend way too much time trying to do things that should be simple. please help! Thank you!

    Are you using method 1 with different windows user accounts?
    http://support.apple.com/kb/HT1495
    Sounds like you are currently using method 2 and not happy with it.

  • Planning for  product using multiple bom and multiple recipe involving SOP

    Hi friends,
    The problem. Currently we have maintained single BOM and single recipe (The BOM and Recipe used for MRP) for long term planning run. The FMCG sector of Client requested to have multiple BOMs and multiple recipes in the long term planning run. I.e. The planning is done quarterly and they wanted to use different BOMs and Different recipes for each quarter. But since the existing system has configured to use a single BOM and a single recipe we have a problem to use the long term planning run with the current setups.The problem we have is in this ‘001’ planning scenario.
    appreciate if you can help me how to accommodate multiple BOMs and recepis in the long term planning run.
    thanks and regards
    om

    HI Mr. Ready,
    We create PIR though a submit Job and in this case how to mention the production version while creating PIRs . Also if I am creating PIR through MD61 how to record the version.
    Please advice.
    Thanks and Regards,
    Om

  • Newbie - Be gentle - Using multiple computers and IPods

    I have 3 kids wanting to use my computer and a separate computer at their other parents' house for ITunes. Can this be done? How? We have already had problems with ITunes erasing songs from one computer etc. Any help appreciated.

    you need to set up the ipods for manual synching go to edit>prefernces iPod tab. This way you can add music from either PC without deleting what is on the iPod

  • Mail.app using multiple identities and outgoing servers, how to map them?

    Hi all,
    I am using mail account and my main account (gmail) is defined as IMAP on it.
    In my gmail settings, all my other mails are forwarded to this e-mail account so I don't need to define my other mails to get those mails (since I get them from my mail account).
    When sending an e-mail or replying, I want to use the same identity that the mail was sent to and the same outgoing mail server.
    For now, I successfully defined my different identities in my main account (i.e., I added them in the e-mail address field with comma separated values), and I also managed to define different outgoing servers (from account -> outgoing servers). However, my problem is that, I cannot link an identity to an outgoing server. They are all linked to my default mail's outgoing server by default and I have to manually select them every time I sent an e-mail. However what I want is the following:
    Let's say that I have 2 identities: id1 and id2 and two outgoing server os1 and os2.
    I want the mail.app to select os1 whenever I selected id1 and os2 whenever I select id2.
    I want the mail.app to select os2 whenever it decides to use id2 (because the e-mail was sent to id2) and the same for the other os-id pair.
    Is this possible? All help is greatly appreciated. Thanks in advance, and do ask if you need more information.
    Regards,

    Have you tried restarting or resetting your iPhone?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after It shuts down, press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds).
    Also consider deleting and reinstalling the Mail Account in question.

  • Not using multiple processors... and taking FOREVER

    First off i have a love/hate relationship with compressor / qmaster
    Here is what i am getting now... I hope someone can help
    When i submit a batch to the Cluster (6 instances) it is no longer splitting the job out. It instantly goes to 10% completed and then just CRALWS along. It took it 14 hours to compress a 20 min Uncompressed 1080 24p movie to H.264 720 24p movie.
    This is a fresh install of Snow Leopard, FCS and all drivers.
    I have uninstalled and reinstalled compressor two times.
    I have removed ram / changed ram.
    I have removed all cards in the computer
    any ideas?
    ken

    Do you have the option "Allow Job Segmenting" checked on your setting? Also, in your project, are you POSITIVE you didn't make any minor (accidental) scale or position changes in the motion tab? It doesn't matter how much of a change. If you make even a little change it adds considerable time to your encode. I often see people who work in wireframe mode make small changes to the centering of the clip without even knowing it. If you go into the motion tab make sure every clip has a center of 0-0, unless you intentionally want the change, in which case you just have to eat the render time.

  • Help using multiple computers and one shared external drive

    I just "bought" the new LR / PS combo special.  I have 3 computers, 2 PC's in seperate cities and a laptop that I use on the road. I would like to use an external hard drive as the main drive.  This way I could take the drive with me.
    2 Questions....First I tried to learn the basics using the internal hard drive on PC#2.  I then set up a external drive with multiple folders but within one main folder. I then started importing to the external drive using PC#2 (which is at my vacation property). Everything went smooth until I tried to import from that external drive,  It does not open that catalog. I am saving them as digital negatives.
    Question #2 which I have not tried yet is PC#1 which is my main home computer does not have LR.  I have years of photos in hundreds of files sorted in bridge that have to be renamed and put on the hard drive.  It does not have the latest version of PS and I have lots of money invested in plug ins. How can I get lightroom on that computer and will it talk to what I believe is the prior version of photoshop. I don't even want to think about all the plug ins.
    It's pretty clear that I am lost.  I was going to continue using bridge and PS but there is no bridge on the new version, at least not on the $9.99 special.  From what I've seen, LR is the way to go.
    HELP

    Mantis wrote:
    I was going to continue using bridge and PS but there is no bridge on the new version, at least not on the $9.99 special.  From what I've seen, LR is the way to go.
    Bridge should be included in the $9.99 bundle http://www.adobe.com/products/creativecloud/faq.html#pslr-bundle

  • Can DIAdem 2012 use multiple processors on Quad Core CPU?

    Hi,
      I am running scripts in DIAdem 2012 which take upwards of 10 minutes to complete.  However, I notice my CPU usage never goes above 15% during this time.  My understanding is that that generally suggests the software is not 64-bit compatible and therefore not taking advantage of the other cores (I'm on a quad-core i7).  I also have 12gb ram and that is not being heavily taxed by DIAdem either. 
      Anybody know how I can squeeze some extra juice out of my computer to help DIAdem run faster?  Thanks!

    Hello Mark,
    Multi-core support only makes sense for very few operations in DIAdem (i.e. Large amounts of data being sent through an FFT routine) and is currently not supported. Also, 64-bit only makes a difference when working with very large data files.
    That said, there are ways to improve processing speed in DIAdem without using extra cores or 64-bit versions of software. My best suggestion is to get in touch with our senior Product Support Engineer (Dr. Brad Turpin) and combing through your Script(s) to see where there is potential to improve processing speeds by optimizing the Script(s). I'm not implying that your Script(s) are badly written, I just know from experience that changing a few things in the Script(s) has lead to reduced processing times by using optimized functions in DIAdem that you might not be aware of.
    Dr. Turpin can be reached at this email address: brad DOT turpin @ ni DOT com
    Please reference this forum thread when you contact him.
    Best regards,
      Otmar
    Otmar D. Foehner
    Business Development Manager
    DIAdem and Test Data Management
    National Instruments
    Austin, TX - USA
    "For an optimist the glass is half full, for a pessimist it's half empty, and for an engineer is twice bigger than necessary."

  • How to use Wait Screen and Thread?

    Greetings,
    I was wondering If I could ask a question...
    Here it goes:
    How can I use a Wait Screen in a MIDlet so that I can do the Following:
    1.- Create and Open an Http Connection[b[i]](using an Object which extends Thread) in a Form by pressing an OKCommand.
    2 .- Show the Wait Screen Until the Thread Object finishes execution(finishes whatever is inside run() method)
    3.- Finally show the Result(s) of the Connection(bytes obtained from URL) in another Form.
    First of all, Is what I ask even possible? and more importantly...
    Can a Wait Screen actually Detect when a Thread finished execution? so that only when the thread finishes the program proceeds to the next statement?
    Thank you very much in advance!
    Sincerely, your friend,
    Jose

    Thank you very much Sir, I suppose that narrows it down a bit,
    Because I definitely need my applications as standard as possible.
    But good to know there's a way to do it.
    Well, Thank you very much as usual!
    Sincerely,
    Keep up with the fantastic job you do every day!
    God Bless.
    J

  • Using multiple laptops and AirTunes with one static IP

    I just moved into a place that requires a static IP they provided me. After much tinkering, I finally got the Airport Express to work so that I could get online using my Powerbook. However, whenever I'm on the internet (Airport set NOT to distribute IP addresses), I can't use AirTunes. The moment I change that (whether it's using Airport Admin Utility or changing Network Settings on the Powerbook) and I am able to get online again, AirTunes quits and iTunes can't seem to find the remote speakers again.
    I can't even use these both at the same time, and I would eventually like to use AirTunes at the same time as the internet AND be able to connect wirelessly to the internet using my PC laptop. Before moving into the apartment with the static IP, this was possible.
    I keep reading about port mapping - perhaps that is the answer? Problem is, I have no idea what that is. Can somebody please explain why this is happening and offer a solution?

    a) WEP WPA password, ive never set one up for the airport, where do i find out what this password is for my PC?
    You will set up wireless security (WEP or WPA) on the AirPort Express Base Station (AX)..using the AirPort Admin Utility, which is part of AirPort for Windows.
    b) Everytime I run the Airport Express Assistant it gives me an error message saying "Windows is not the current network manager...please change Windows to the default", I dont know why I get this error and I assume windows is the one managing the networks I use.
    Your PC has wireless capability...correct? The AirPort Setup Assistant requires a wireless connection to the AX.
    c) I can connect to the airport through windows, but when in the Airport Management Utility it does not detect the Airport
    Connect your PC directly, using an Ethernet cable, to the Ethernet port of the AX, and then run the AirPort Admin Utility to configure it.
    d) After all this, will Windows and iTunes allow you to stream music thru the Airport Express, like it does on my mac with itunes???
    Yes, you will be able to stream iTunes from your PC to the AX, either wired or wirelessly.

  • Can I use multiple tags and genius to select music for a certain event?

    Hey,
    So for example I may have a few favourite albums I like to listen to when I go to sleep, they may have different tags like folk, electronica.  If I tagged them something like Folk sleep, electronica sleep, could I then find all albums with Sleep somewhere in the tag using Genius.  I want to do the same for albums I like to listen to when I run or when going out or when sad etc....
    I find the tags folk, rock too limiting, I would rather mostly select music based on moods / events.  I don't want a play list, I just want to be able to see music that I like to sleep to and select one album from the list.
    Any suggestions?
    Thanks,
    Charlie.

    What you need is to learn how to use Smart Playlists.
    When iTunes is open, at the extreme lower-left corner is a plus sign. This opens a regular Playlist that you can drag songs into it. If hold down the Option key, the plus symbol will change to a gear symbol. When you click on you will get a Smart Playlist set-up dialog. It's fairly self-explanatory how to use it. In your case you want to do something like Genre contains "sleep". To add more rules just click the plus button on the right.

  • Using Multiple Datasets and Spry in DW CS3

    Hi there, I am currently trying to get an XML file pushed
    into a HTML page by using Spry in Dreamweaver CS3.
    However it uses three datasets. The schema is like this:
    funds-and-headings
    ----> properties+
    ------------> region
    ------------> reference
    ------------> known-as
    ------------> funds+
    ---------------------> type
    ---------------------> heads+
    -----------------------------> description
    (where there is a + this means a heading)
    but I am struggling to pull in the data.
    If I highlight 'properties' I can pull in the first 3 records
    but funds gives an 'unspecified' error message.
    I just want to know how I can then pull in the other fields
    all into one line and return all the results from the XML.
    Any hlep most welcome and sorry if I missed anything out that
    would help.

    Thought I'd drop a url so that my issue is more clear. :)
    This is in Alpha, but a url would be:
    http://center4spine.com.s11267.gridserver.com/how_we_help/spinal_decompression/
    . You'll see the categories on the left; clicking a title changes
    the content on the right. The first category's content is displayed
    initially. I need to be able to link directly to the FAQ. How do I
    get that page to show up with the FAQ loading first via a
    hyperlink? I hope that's more clear!

  • Simple clock using a frame and threads

    I'm having alot of difficulty getting this program to work correctly. There are actually 2 issues here. The first one is that when I am using a lable, showTime, on the frame it is only updated once though the thread has a while(true) statement. The second issue is that using the drawString method NOTHING is diaplayed. While I know that there are many other solutions to this problem, I would like to know what I'm doing wrong with this code. It's just to simple to not work. Any help would be greatly appreciated. Here's the code.
    Doug
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    class Clock extends Frame implements Runnable
         Calendar c;
         private Thread time = null;
         int hours=0;
         int minutes=0;
         int seconds=0;
         Label showTime=new Label("00:00:00");
         public Clock()
              c = Calendar.getInstance();
              add(showTime);
              addWindowListener(new CloseListener());
              time = new Thread(this);
              time.start();
         class CloseListener extends WindowAdapter{
              public void windowClosing(WindowEvent e){
                   System.exit(0);
         public void run(){
    while(true){     
                   hours = c.get(Calendar.HOUR);
                   minutes = c.get(Calendar.MINUTE);
                   seconds = c.get(Calendar.SECOND);
                   repaint();
                   try{
                        Thread.sleep(1000);
                   } catch(InterruptedException e){
                   return; }
    public static void main(String args[])
              Clock clockDisplay = new Clock();
              clockDisplay.setSize(400, 400);
              clockDisplay.setTitle("Clock");
              clockDisplay.setVisible(true);
    private String format(int input){
              if (input <10)
                   return ("0"+input);
              else
                   return(""+input);
         public void paint(Graphics g){
              showTime.setText(format(hours)+":"+format(minutes)+":"+format(seconds));
              g.drawString(format(hours)+":"+format(minutes)+":"+format(seconds),40,40);

    Hi,
    Your Calendar is not updated after each interval. When you add
    c.setTime(new Date());
    in your "run" method, after the line
    while(true){
    then it should work.
    Hope this helps,
    Kurt.

Maybe you are looking for

  • How do i edit photos with out geting rid of the orginal

    I try and edit photos, in Iphoto, but how do i edit a photowith out it geting rid of the orginal?

  • New final BIOS 1.9 not good for OC!

    Just flashed the final 1.9 although I was perfectly happy with the 1.9B3. With the latter everything ran fine with "Ultra Turbo" mode and 270 MHz FSB (P4 2.6 @ 3.51 GHz) -> rockstable 24/7 with Prime95 and distributed computing etc. Now I had to go b

  • Polling over https not working

    Hi, How do I change below to make it work with https? I tried with AMFSecureChannel but that did not work. Appreciate any help... thanks! <channel-definition id="my-amf-poll" class="mx.messaging.channels.AMFChannel">     <endpoint         url="http:/

  • .mac and personal domain question

    I'm sure this has been addressed several times, although, I can't find the answer in a quick search... I set-up a personal domain on my account. I have several websites going in iWeb, however. Can I still host my personal domain on .mac, but still pu

  • Failure to deploy dimension - ORA-01031: insufficient privileges?

    Hi all, 1. I imported a mdl file. 2. Then I registered all locations 3. Then I deployed all staging area objects successfully. 4. Then I deployed sequences and tables in the target module successfully. 5. However, when I want to deploy the dimensions