How to run two thread parallel y on two cores of dual-core ??

I want to run two threads on two cores ???
is there any package which support parallel computing??
can we do this by using java.util.concurrency pakage??
Thanks you
please Reply.....

vikram_p wrote:
I want to run two threads on two cores ???ok
Threads are automatically spread over the available cores, as the OS sees fit.
is there any package which support parallel computing??Java does so without any external libraries.
can we do this by using java.util.concurrency pakage??yes
One question mark per question is plenty, thank you.

Similar Messages

  • How to run a VI parallel to another?

    Hi, I am a newbie in LabView and I want to know how to run a VI
    parallel to another one. I have a SubVI in my program and every time
    this SubVI is running the program can't react for example for pressing
    a button. I have to wait until the SubVI is finished. How can I solve
    this problem?
    Thank you
    Marco

    Your question is very general, so it's hard to give a precise answer, but I would guess that the subVI and your button are found in the same loop, right?
    In LV, there is one very important principle - a "piece of code" will only execute when all the wires leading to it have delivered their data.
    If my assumption is correct, what is happening, most likely, is that your subVI takes time to run and the loop will not go to the next iteration until all the code in the current iteration has finished running. That's why you will see that the button was pressed, but nothing happens, because it wasn't read yet, and won't be read until the next iteration.
    Making code run parallel in LV is very easy - just place in the diagram so that there is no connection between the two different parts of code. If you place 2 unconnected loops, they will both run in parallel. This is probably the simplest solution to your problem, but you will need some way to synchronize the loops (like when do you run the subVI?). It's customary to have one loop which will be dedicated only to user interface, and you can add as many other loops as necessary. If this doesn't help you, I suggest you post your code (File>>Save with Options>>Development Distribution), so we can provide a specific answer.
    To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    Try to take over the world!

  • How to run two query  in the same preparedStatement

    Hi all,
    Please tell me how to run two queries in the same preparedStatement object ?
    In my module I have to run two queries and I don't want to make two methods for running two different queries.
    I just want to call this method for both of my queries.
    methodName(long param)
    Connection conn=null;
    PreparedStatement pstmt=null;
    //////////////// some coding
    Please Help !
    Thanks in advance
    amitindia

        public void foo()
            Connection connection = null;
            PreparedStatement stmt = null;
            try {
                connection = ...get from pool...;
                stmt = connection.prepareStatement("...");
                ...fetch results...;
                stmt.close();
                stmt = null; // So the finally statement works if there is an exception
                stmt = connection.prepareStatement("...");
                ...fetch results...;
            } finally {
                if (stmt != null) ..close it...;
                if (connection != null) ..return it to pool...;
        }

  • How to run two versions of dreamweaver at the same time

    How to run two versions of any dreamweaver at the same time?
    There must be a way to do this.

    east99 wrote:
    > How to run two versions of any dreamweaver at the same
    time?
    > There must be a way to do this.
    Yes, there is: on two separate computers.
    You cannot run two versions of Dreamweaver simultaneously on
    the same
    computer. They can coexist side by side, but the operating
    system will
    not let you run them together.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • How to run two icalenders on the same computer?

    How can i run two separate icalenders on the same computer? I have my own icalender with work, home, etc, and it's totally full. I am now running an artists collective and will publish the collectives icalender on the web. I don't, however, want to mix what will be a pretty busy calender with my own already too full one. Is it possible to run two totally separate calenders on the same computer?
    macbook   Mac OS X (10.4.8)  

    trsv,
    Welcome to Apple Discussions.
    Create two Groups...
    Calendar 1:
    Work
    Home
    etc
    Calendar 2:
    Collective Calendar
    You can then switch which groups you wish to display by activating/deactivating the check mark in the Calendar source window.
    That will also allow you to selectively publish the Collective Calendar.
    ;~)

  • How to run a thread for second time ?

    I have a written a ThreadPool, but I found that basically a thread is not running for the second time. i.e First i call run() method and call stop(). If i call again run() method for the same thread, it is not running. What should I do, If i want to run the thread for the second time ?
    class NewThread implements Runnable {
    String name;
    NewThread(String a) {
    name=a;
    public void run() {
    try{
    for(int i=0;i<5;i++) {
    System.out.println("Thread :" + name + " #" +i);
    Thread.sleep(5);
    catch (Exception e) {
    e.printStackTrace();
    class threadRunnableTest {
    public static void main (String args[]) {
    Runnable runnable=new NewThread("BaSkAr");
    Thread thread = new Thread(runnable);
    try{
    System.out.println("First Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("First Thread it to be stopped!!");
    thread.stop();
    System.out.println("Second Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("Second Thread it to be stopped!!");
    thread.stop();
    catch (Exception e) {
    e.printStackTrace();

    baskark wrote:
    I have a written a ThreadPool, but I found that basically a thread is not running for the second time. i.e First i call run() method and call stop(). If i call again run() method for the same thread, it is not running. What should I do, If i want to run the thread for the second time ?
    class NewThread implements Runnable {
    String name;
    NewThread(String a) {
    name=a;
    public void run() {
    try{
    for(int i=0;i<5;i++) {
    System.out.println("Thread :" + name + " #" +i);
    Thread.sleep(5);
    catch (Exception e) {
    e.printStackTrace();
    class threadRunnableTest {
    public static void main (String args[]) {
    Runnable runnable=new NewThread("BaSkAr");
    Thread thread = new Thread(runnable);
    try{
    System.out.println("First Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("First Thread it to be stopped!!");
    thread.stop();
    System.out.println("Second Thread is starting !!!");
    thread.start();
    Thread.sleep(2000);
    System.out.println("Second Thread it to be stopped!!");
    thread.stop();
    catch (Exception e) {
    e.printStackTrace();
    It's usually helpful to check the documentation:
    [http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#start()|http://java.sun.com/javase/6/docs/api/java/lang/Thread.html#start()]
    start
    public void start()Causes this thread to begin execution; the Java Virtual Machine calls the run method of this thread.
    The result is that two threads are running concurrently: the current thread (which returns from the call to the start method) and the other thread (which executes its run method).
    It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.
    So, make a new java.lang.Thread

  • How to run two libraries? [11.0.0]

    Hey everyone. I've been using iTunes for a long time now, as it is a relatively good program for organizing my huge library> I don't use it to listen to music, but I often need to move files around and onto the appropriate devices for my family. Because of this, I got an external hard drive. From time to time, iTunes will forget that my library comes from my external. usually, this is after booting iTunes without having the external plugged in. This can be a nuisance, because iTunes then decides to fill up my laptop's free space with the large amounts of music I put on at once. It gets especially annoying when I need to consolidate files to ensure they are all on the hard drive because it will consolidate to the computer instead.
    My question is, how do I set iTunes up so it will always look for my hard drive and use that as the library first? Then, and only then, if it cannot find my hard drive, it will use my computer's storage. Most important to solving my problem is that during those times it uses my computer's storage, it should automatically use my hard drive if present upon restarting iTunes.
    I have figured out how to have two libraries, but I need to know how to put one on a higher priority and as a default that doesn't get changed.
    To recap, If I run iTunes without my external hard drive, it changes the library location to my computer and does not put the setting back to how it was.

    Aarowaim wrote:
    how do I set iTunes up so it will always look for my hard drive and use that as the library first?
    This is done by default, but it is up to the user to ensure the external or network drive is connected.
    Aarowaim wrote:
    Then, and only then, if it cannot find my hard drive, it will use my computer's storage.
    Again, this is done by default.
    If the user fails to connect the external drive before started iTunes the following steps should be taken.
    Close iTunes.
    Connect drive.
    While holding SHIFT, launch iTunes.
    When prompted to locate or create a new library, select locate and point iTunes to the external drive.
    Is the iTunesLibrary.itl file actually on the external drive or is it on the C drive of the computer?

  • Does anybody know how to run two independent instances of Calendar simultaneously?

    I've enabled the Debug mode, and have 2 windows open at the same time but can't get them to operate independently. Anybody done this?
    The situation is that I work for a music school that uses iCal to keep track of music lessons for multiple tutors in real time, which sync to relevant tutor's iphones. We've just opened a second premises and would like to use the same system, but be able to monitor everything from either school.
    Debug mode will let me run two instances of Calendar simultaneously, but removing tutors' calendars from one of the Calendar windows removes them from the other.
    Basically I need one Calendar window open for each school, and for them to be independent from each other.
    Any takers?

    How about creating a new "Calendar" with in the same Calendar app?
    Calendar App---> File---> New Calendar
    Name each Calendar for each business location. Example if the original location is on Main St, name that Calendar Main St and the second on Broadway, name that calendar Broadway.
    The other solution could be the same as above, but File---> New Calendar subscription. But I have no idea how that works though.
    KOT

  • How to run two files with same url-  urgent

    hi,
    i created two servlet page and both are working very fine.but at same time i only able to run one file with same url. Is possible to run two or more file at same time with same url name..
    if you r not understanding what i want to ask then, i have two file names under helloWeb directory
    1) helloWorld.java(servletname s1, url /man)
    2) helloWeb.java (servletname s2,url /man)
    to run - http://localhost:7001/helloWeb/man - it runs very first file which is added to deployment module.
    so i want to know how i can run both file with same url, for this what i have to pass on my address bar.
    plz help me i m wating
    <b></b>

    Hi,
    We can give same url mapping to both Servlets but we can access the servlet which is entered first in web.xml because whenever we send a request to the webserver then webserver look at the elements in web.xml file one by one.
    When it finds the corresponding url mapping then immediately sends the response to the client.The same url mapping for the next element will be ignored.
    I think there is no possibility to access both servlets with same url.
    Regards
    Anilkumar kari

  • How to run two instances of WoW on a Mac?

    So I am looking to run two windows/instances of WoW on my mac. Basically so I can use my mage on a seperate account to rush my lowbies through instances. It wont let me simply load the game twice like on a PC, does anyone have any ideas how I could do it?

    I've never played WOW so I do not know how the settings are setup on a Mac but one way that you might be able to do it is to create a second account and try running it in both accounts. Go to System Preferences/Accounts and click on the plus to create a new account. Next click on Login Options and put a check in the box that says Enable Fast User Switching. Then from your Finder in the top right hand corner you will be able to switch between your 2 accounts.

  • How to run two sub vi simultaneously??

    i need to run two sub vi simultaneously in one main vi, becasue it is a must the two sub vi run exactly at the same time, but now i find that if i put they in one diagram ,in fact they are not exactly run at the same time. if you see in high light mode Just like the attached simple example code.  any one can help me to handle this to run the two subvi exactly at  the same time ? how to do it ? thanks so much.
    Attachments:
    how to run subvi simultaneously.vi ‏11 KB

    You are correct, they will not run at exactly the same time.  What is it you are actually trying to do?  What platform are you developing on? What version of LabVIEW? What processor does your target system have? This information is vital in order for us to assist you.  In a nutshell, unless you are running a real-time OS, then the OS you are running is not deterministic.  When you say "at the same time", what are you actually referring to? As a note, when executing parrallel operations in LabVIEW, the execution order may or may not be the same with the highlight bubble on as it is when it is running without highlight execution.  It is highly unlikely that you will be able to just run two sub-vis at the exact same nS.  If you are using DAQ boards, you accomplish this through triggering.  Please give a detailed description of what you are doing, and what you see the road blocks being.
    Thanks
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?

  • How to run two Automator actions simultaneously?

    I want to perform two actions at once in an automator applcation, specifically Speak Text and Run AppleScript. I can only figure out how to run one after another. Is there a way to have text spoken as a script is run?

    This is what it looks like:

  • How do run two instances of a LabView program

    Hi,
    I have a LabView application that is used for RS-485 diagnostics with a 2-port PCMCIA card in a laptop.  The application is written to access only one of these ports at a time, although the user interface does allow the user to choose which one.  What I need to do is to run two instantiations of this application, accessing one port per application, yet keeping them completely independent.  How do I do this?
    So far, I have complied an executable application, but they don't seem to be independent.  Could it be that opening one port interferes with the other.  Also, renaming the app doesn't seem to work.  It does seem clear that I have to run a compiled application because I can't run the same VI with the same subVI's independently within LabView.
    Thanks,
    Jason

    Jason,
    Here are a couple of things to think about:
    To run within the LabVIEW environment you could make the subVIs reentrant. This creates a separate data space for each instance of the VI. It does, however, mean that you cannot use the subVI's front panel.
    The built executables share the LV run time engine so there may be resource contention when you try to open the second port.
    I think you should be able to write a program in LV using VIs without reentrancy that will do what you want. Try a simple program which opens Port 1 and then Port 2 using the standard communications VIs (VISA?) and checks for errors. Multiple port stuff is done all the time. Unless the PCMCIA card does not support it. If this works then you could put together a program which monitors both ports as a single port and the port number is a parameter.
    Lynn

  • How to run multiple Thread using Scheduler's in 1.5

    Hi,
    I have a scenario, in which I have to run a Thread at every 15 minutes, If the first Thread is not Finished in 15 min then new Thread has to start.
    Currently I implemeted with java 1.5 schedulers, but the problem is if my first Thread is taking more than 15 min, then no new Thread is starting.
    Following is my Code:
    TestAccountingThread accountingThread = new TestAccountingThread();
    ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(10);
    scheduler.scheduleAtFixedRate( accountingThread, 0, 60, SECONDS );
    Can any one help on this, This is really urgent.
    Regards,
    Suman

    if my first Thread is taking more than 15 min, then no new Thread is startingIf it takes more than 15 min, manually run a new scheduler with initial-delay=0 and shutdown the current one when the current execution is finished --- and repeat this logic in a conditional loop.
    Could this be what you want?

  • How to run two or more reports in parallel?

    Hi,
    Scenario:
    I have created three report programs. After the first report is processed, I prepare a selection parameter based on the result  and call the other two programs simultaneously by using the SUBMIT command.
    Issue:
    As the other two programs are completely independent, I want the these to run in parallel and return the result set.
    Can anybody suggest how do I achieve this?
    Regards
    s@k

    Dear Radhika,
    Thanks..:)
    To add to the problem, after the first program is processed and I get the result, I prepare a selection parameter table. This
    table I pass to the other two programs as shown:
    Program 2:
      SUBMIT <program_name> AND RETURN
              USER sy-uname
              WITH SELECTION-TABLE lt_params_1.
    Program 3:
      SUBMIT <program_name> AND RETURN
              USER sy-uname
              WITH SELECTION-TABLE lt_params_2.
    As suggested by you, I have checked for the job options. I found that i need to call the function modules in the order as
    1. JOB_OPEN
    2. JOB_SUBMIT
    3. JOB_CLOSE
    The question is how do i pass the selection parameter table in the FM JOB_SUBMIT? I can see there is a report parameter but how do I pass the table to it
    Can you please suggest.
    Regards
    s@k
    Edited by: siemens.a.k on Feb 4, 2010 4:03 PM

Maybe you are looking for

  • Looking for App builder

    HI...I am new to community.  I am looking for someone to build an app for my sales team.  I have about 300 people who are in and out of retail stores and I would like to develop a standard retail audit form that they could fill out on the go.  Please

  • Error while creating Records Center site

    Hi, I am trying to create a Records Center site on my Dev environment from Central Admin. However it throws below error: looking for this correlation ID in ULS logs, I found errors like: 1. Failed to find <ListTemplate> tag corresponding to ID "101",

  • Itunes won't open, update, install, uninstall, Windows DEP prevents me doing anything with itunes.

    I have tried all the solutions on here so far, Windows Vista DEP stops itunes working and despite me being administrator I don't have the "privaleges" to remove programs and re-install!! Itunes wont install 10.5 but no error message pop up.

  • Limitations in weblogic server 8

    I found a major limitation in weblogic 8.           There is no direct way to test/validate the CCI connections.           Also destroy the faulty connections. I found a way to destroying the faulty connection but unfortunately i am getting some exce

  • Shortcut not working in cs6

    The keyboard shortcut command - h does not work. But it does from the menu bar drop down under Dreamweaver. On a mac 10.7.4