Multi-threads will run better on multi-Processores environment?

Are there any proof to say that Multi-threads will run better on multi-Processores environment?
Will Java run better on multi-Processores environment? Are there any proof?
Thank in advance

Are there any proof?The proof is in the pudding, so to speak. The best thing to do is to benchmark your application on single and multi-processor machines.
It should be noted that there are reports of threading problems with Java on multi-processor machines. I haven't seen the problems myself, nor do I remember the exact problems people were seeing (and on what OS/Hardware) but if you search these forums you should be able to find out the details.

Similar Messages

  • IPC on multi-processor environment

    I have written a C program which uses IPC resource "message queue" and "shared memory" on a single processor SUN Sparc workstation (with
    Solaris 2.5.1 OS).
    I would like to know whether my program can function correctly if it runs on a multi-processor SUN platform (e.g. Sun HPC model 450 with more than 1 CPU installed).
    Does anyone have any experience on this?
    Best Regards,
    Annie

    Hi.
    The IPC features will work find in an MP environment. It is designed for processes which are normally protected from each other to be able to exchange data. You just have make sure that access to your message queue or especially shared memory is synchronised between multiple processes by using semaphores (see semget(2)).
    You could also look at using just one process but multithreading it.
    The multithreaded programming guide covers the issues.
    Have you expereienced a particular problem?
    Regards,
    Ralph
    SUN DTS

  • ThreadPoolExecutor and using priority to determine what threads will run

    Hello,
    I am fairly new to Java, so I apologize if there is an obvious answer.
    The ThreadPoolExecutor is a great class for thread management. What I would like to do is have a priority scheme that would determine what thread should be run next. For example, let's say I have 100 threads and a limit of 20 threads. Each thread that is executed should have a mechanism to indicate a priority. When a thread becomes available in the pool, the priority value should be checked to determine which thread to run. This would allow me to get important tasks completed quickly. Right now it appears that there is a FIFO order to threads. I tried wrapping the runnable object in a Thread, but that didn't seem to have an effect.
    I am using a Fixed thread Pool:
          loThreadPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(MAXTHREADS); (MAXTHREADS=20)I have tried creating a PriorityBlockingQueue with a comparator that compares the thread priority, but nothing seems to work.
      public Constructor() {
    loThreadPoolExecutor = new ThreadPoolExecutor(MAXTHREADS,MAXTHREADS*2,0,TimeUnit.SECONDS,new PriorityBlockingQueue(11,new PrvComparator()));
        private class PrvComparator implements Comparator  {
              public int compare(Object o1, Object o2) {
                   // TODO Auto-generated method stub
                   Thread t1 = (Thread) o1;
                   Thread t2 = (Thread) o2;
                   System.out.println("P1="+t1.getPriority()+ " P2="+t2.getPriority());
                   if (t1.getPriority()<t2.getPriority()) return -1;
                   if (t1.getPriority()>t2.getPriority()) return 1;
                   else return 0;
                   //PriorityBlockingQueue
              }I would appreciate any help.

    What are you trying to prioritize? The order on which tasks come off the work queue, or the order in which they get completed?
    Doing the first is simple but restricted. Your tasks are Comparable and define their own priority and you use a PriorityBlockingQueue. But you are restricted to using the execute() method with Runnable's that are Comparable. submit() will wrap the task in a FutureTask that isn't Comparable and so will cause a ClassCastException.
    Doing the second is difficult. Even if your threads have different priorities then don't queue for tasks in priority order, so the thread priority when taking a task is irrelevant. You could change the thread priority based on the priority of the task once it starts executing. But Thread priorities are only a hint to the scheduler that you think Thread A is more important than Thread B. On some platforms priorities will have little observable effects - whereas on other it can be drastic if you use priorities that are too high or too low. The mapping from Java priority to OS thread priority is platform specific. See for example http://java.sun.com/javase/6/docs/technotes/guides/vm/thread-priorities.html

  • Multi Processor environments

    Just a quick question for ye, no detail really required at this time.
    Is it possible to run a multi threaded Java application in a multi processor environment, where the processors would share the work between them.
    I suppose basically what I am asking is does the JVM have the capabilities to run multiple threads across multiple processors.
    If the answer to this question is yes, how difficult is it to set up or is there any special requirements, or extensions required.
    Cheers

    In most current JVMs, the facilities of the OS to spread the execution across the system's CPU's is provided to the Java programmer quite transparently. Avoid 'green threads' and you are good as gold.
    On Solaris 7 and earlier, it gets tricky to convince the two-level kernel threading mechanism to really use all CPU's (or even more than one). The Sun JVM's for Solaris provide 'unsupported' but often suggested command line options to use 'bound threads' to solve this problem and Java 1.3.0 and 1.3.1 do a much better job. I've run WLS on 10-way 4500 systems and was able to consume about 70% of the 10 CPU's with productive work - principal limitation was our ability to apply load to the system.
    In Solaris 8, there is an alternate thread library that a process can choose to use (just put it in the front of the LD_LIBRARY_PATH). This causes that process to use a one-level (or flat) Solaris thread model which can improve performance (and will definitely increase processor utilization) on larger SMP systems.
    Chuck

  • Multi processor Solaris 2.6 and mutex locks

    hi,
    is anyone aware of any documented issues with Solaris 2.6 running
    on dual-SPARC processors (multi-processor environment) where the
    programs using "mutex locks" (multi-threaded applications), require
    some special handling, in terms of compiling and linking, to some
    special libraries.
    as far as i remember, in some OS book, maybe Peterson's, it was said
    that the mechanism for implementing mutex-locks on multi-processor
    systems is to use low-level spin-locks. this brings down performance
    on a single-processor system, making the processor doing busy-wait,
    but this happens to be the only way of mutex-locking in a multi-processor
    system. if this is so, then where is such behaviour documented in case
    of Solaris 2.6.
    i have had problems with my applications crashing (rathing hanging up)
    in a vfork() on such a system, but same application works fine, with
    100% reproducability, on a single-processor system.
    thanks for any inputs or suggestions and/or information.
    regards,
    banibrata dutta

    I am also facing similar problem. Application which written using Mulit-Threaded using Posix Mutexes. When i run on SINGLE processor manchine, i.e.
    SunOS sund4 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10
    It works perfectly.
    But when try to run on dual processor machine, i.e.
    SunOS sund2 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-250
    It is blocking in the one of mutexes.
    Please inform us what is problem. Mr. B. Datta, you comes to know
    any channel, please inform me also at [email protected]
    Thanx & regards,
    -venkat

  • I'm running OS10.6.8 on an "old" Macbook Pro with Intel Core Duo 32. My work computer is down and I need to use Photoshop and cannot find a version that will run on here! It lets me use Illustrator 10, Indesign CS6, but Photoshop 4, 5, 5.5 and I can't get

    Please help.

    Your macbook pro has a 32 bit processor and not a 64 bit processor?
    If so, i believe photoshop cs5 is the newest photoshop version that will work on your Macbook Pro.
    System requirements | Photoshop
    You can get a 30 day trial trial version of photoshop cs5 from here:
    http://helpx.adobe.com/creative-suite/kb/cs5-product-downloads.html
    Also, photoshop cs through cs4 should work as well, but cs3, cs4 and cs5 will run better since cs and cs2 require Rosetta and can be kinda slow at times.

  • Multi-processor Multi-Threaded deadlock

    Hi all-
    I've posted this over at jGuru.com and haven't come up with an effective solution but I wanted to try here before I reported this as a bug. This deals with kicking off many threads at once (such as might happen when requests are coming in over a socket).
    I'm looking for a way to find out when all of my threads have finished processing. I have several different implementations that work on a single processor machine:
    inst is an array of 1000+ threads. The type of inst is a class that extends threads (and thus implements the runable interface).
    for (i = 0;i<Count;i++)
    inst[ i ].start()
    for (i = 0;i<Count;i++)
    inst[ i ].join();
    however this never terminates on a multiprocessor machine. I've also tried an isAlive loop instead of join that waits until all threads have terminated until it goes on. Again, this works on the single processor but not the multi-processor machine. Additionally someone suggested a solution with a third "counter" class that is synchronized and decremented in each thread as processing finishes, then a notifyAll is called. The main thread is waiting after it starts all the threads, wakes up to check if the count is zero, and if it's not it goes back to sleep. Again this will work on the single processor but not the multi-processor.
    The thread itself ends up doing a JNI call which in turn calls another DLL which I just finished making thread safe (this has been tested via C programs). The procedures are mathematically intensive but calculation time is around half a second on a P3 800Mhz.
    Any help on this is greatly appreciated. My next step will likely be tearing down the application to exclude the calculating part just to test the JVM behavior. Is there a spec with the JVM behavior on a multi processor machine, I haven't seen one and it's hard to know what to expect from join() (joining across to processors seems like wierd concept), getCurrentThread() (since 2+ threads are running at the same time), etc.

    My next step will likely be tearing down the application to
    exclude the calculating part just to test the JVM behavior.Sounds like a really good idea.
    Is there a spec with the JVM behavior on a multi processor machine, The behaviour of threads is defined in the specs.
    You might want to check the bug database also. There are bug fixes for various versions of java.

  • Java multi-thread Applet and Multi-processor

    Hello,
    I have a JAVA applet which work fine on a mono-processeur machine and not fine at all on multi-processors.
    It use multi thread (for reading on socket) and some times, request are lost.
    Is that a matter of programming or a JVM bug ?
    This happens on Linux and Windows NT bi-processors.
    We hare using JAVA 1.3.0_02
    Thanks for your help
    [email protected]

    I have already have a look to javax.swing.SwingUtilities.invokeLater() but (I think) it don't work for my need.
    A graphic applet which create 2 threads : one for reading and one for writing on a socket.
    Request sent to the server are memorized in a vector, and once answer is received, the request is remove from vector and treated. Access to the list is protected by synchronize.
    Everything works fine one several plateforme (linux, windows 98/2000/NT, Solaris). The only problem is on multi-processor : request are lost !

  • Concurrency in Swing,  Multi-processor system

    I have two questions:
    1. This is a classic situation where I am looking for a definitive answer on: I've read about the single-thread rule/EDT, SwingWorker, and the use of invokeLater()/invokeAndWait(). The system I am designing will have multiple Swing windows (JInternalFrames) that do fairly complex GUI work. No direct interaction is needed between the windows which greatly simplifies things. Some windows are horrendously complex, and I simply want to ensure that one slow window doesn't bog the rest of the UIs. I'm not entirely clear on what exactly I should be threading: the entire JInternalFrame itself should be runnable? The expensive operation within the JInternalFrame? A good example of this is a complex paint() method: in this case I've heard of spawning a thread to render to a back-buffer of sorts, then blitting the whole thing when ready. In short, what's the cleanest approach here to ensure that one rogue window doesn't block others? I apologize if this is something addressed over and over but most examples seem to point to the classic case of "the expensive DB operation" within a Swing app.
    2. Short and sweet: any way to have Swing take advantage of multi-processor systems, say, a system with 6 processors available to it? If you have one Swing process that spawns 10 threads, that's still just one process and the OS probably wouldn't be smart enough to distribute the threads across processors, I'm guessing. Any input on this would be helpful. Thank you!

    (1) You need to use a profiler. This is the first step in any sort of optimization. The profiler does two important things: First, it tells you where are the real bottlenecks (which is usually not what you expect), and eliminates any doubt as to a certain section of code being 'slow' or 'fast'. Second, the profilter lets you compare results before and after. That way, you can check that your code changes actually increased performance, and by exactly how much.
    (2) Generally speaking, if there are 10 threads and 10 CPU's, then each thread runs concurrently on a different CPU.
    As per (1), the suggestion to use double buffering is the likely best way to go. When you think about what it takes to draw an image, 90% of it can be done in a worker thread. The geometry, creating Shapes, drawing then onto a graphics object, transformations and filters, all that can be done offline. Only copying the buffered image onscreen is the 10% that needs to happen in the EDT thread. But again, use a profiler first.

  • Multi Processor rendering & editing optimization

    Hello,
    Got some great info here from my last post!  So thanx
    So my question is...is it more ideal to use Xeon or multi processor board setups than single CPU chips?  My main aim is for rendering or workflow turnaround since in the next couple of months I might land a nice spot in the top five post companies in my sector...god willing.
    Therefore I plan to build a completely new system either focused on Multi CPU or buying multi crossfire Open CL rendering GPU cards.  I can't find any documentation or recommendations for improved performances in rendering speeds or realtime fx with a Multi CPU board or the NOW added multi Stream or CUDA GPU (SLI or CrossFire) rendering setups. 
    if anybody could explain any myths or facts as to how Premiere Pro takes advantage of CPUs or GPUs would be a big help.  I'm currently using a Quadro 2000 and an i7-990x with 24gb of memory.
    thnx

    Is your quaddro connected to a 10 bit monitor?
    If not, you would be better served by a faster GTX card
    Best Video Card http://forums.adobe.com/thread/1238382
    Also, view the results of the CS5 Benchmark http://ppbm5.com/ to see what is fast

  • WLS on Multi-Processors

    A few questions about WLS 5.1 on multi-processor machines:
    1. Is there anything that needs to be done(other than purchase another
    license) for a weblogic server to work on a multi-processor system?
    2. Will WLS take advantage of all processors with just ONE invocation of WLS?
    Or will I have to run one instance of WLS for each processor?
    3. Will performance gains be uniform or will certain features gain more
    from multiple processors?
    Any answers, insights or pointers to answers are appreciated.
    Thanks.
    -Heng

    >
    I consider WebLogic to be a great no-nonsense J2EE implementation (not
    counting class loaders ;-).Look for major improvements in that area in version 6.0.
    Thanks,
    Michael
    Michael Girdley
    BEA Systems Inc
    "Cameron Purdy" <[email protected]> wrote in message
    news:[email protected]...
    Rob,
    I consider WebLogic to be a great no-nonsense J2EE implementation (not
    counting class loaders ;-). Gemstone's architecture is quite elaboratewhen
    compared to WebLogic, and BTW they spare no opportunity to compare to
    WebLogic although never by name. (Read their white paper on scalabilityto
    see what I mean.) I am quite impressed by their architecture; it appearsto
    be set up for dynamic reconfiguration of many-tier processing. Forexample,
    where WL coalesces (i.e. pass by ref if possible), Gemstone will always
    distribute if possible, creating a "path" through (e.g.) 7 levels of JVMs
    (each level having a dynamic number of JVMs available in a pool) and if
    there is a problem at any level, the request gets re-routed (full failover
    apparently). I would say that they are set up quite well to solve the
    travelling salesperson problem ... you could probably implement aweb-driven
    neural net on their architecture. (I've never used the Gemstone product,
    but I've read about everything that they published on it.) I would assume
    that for certain types of scaling problems, the Gemstone architecturewould
    work very very well. I would also guess that there are latency issues and
    administration nightmares, but I've had the latter with every app server
    that I've ever used, so ... $.02.
    Cameron Purdy
    [email protected]
    http://www.tangosol.com
    WebLogic Consulting Available
    "Rob Woollen" <[email protected]> wrote in message
    news:[email protected]...
    Dimitri Rakitine wrote:
    Hrm. Gemstone reasons are somewhat different.I'm not a Gemstone expert, but I believe their architecture is quite
    different from a WebLogic cluster. Different architectures might have
    different trade-offs.
    However, out of curiosity, what are their reasons?
    Anyway, here is my question:
    why running multiple instances of WL is more efficient than running
    one
    with
    high execute thread count?The usual reason is that most garbage collectors suspend all of the jvm
    threads. Using multiple WLS instances causes the pauses to be
    staggered. Newer java vms offere incremental collectors as an option so
    this may no longer as big of an issue.
    -- Rob
    >

  • OpenSparc used in a multi processor platform?

    Hi,
    I'd like to know if it is possible to implement two OpenSparcT1 into two different FPGAs so as to have a multiprocessor platform. Is there a pre-built platform that handles memories, communication between processors and between memories and processors and all software partitionning for the applications to be run on the processors?
    Thanks for answering,
    Regards.

    The current design assumes the OpenSPARC board (ML505-XC5VLX110T). So the pinout and everything is set assuming that platform. If you go to another platform, you'll need to make changes to work with that platform. Among other things, you may need to use a different memory controller, or at least compile the memory controller with different parameters. Then you'll need to figure out how to communicate between the two OpenSPARC cores. If the FPGA is large enough to fit two OpenSPARC cores, then the communication between the cores gets easier. Otherwise, you'll have to evaluate what options you have on the target platform for communicating between two FPGAs on a board, or between two Boards. It may be that the Xilinx Aurora block may still work, even though it is running over a different physical interface. Of course, if your platform is an FPGA from a different manufacturer, you'll have to start from the beginning with all-new IP.
    The current two core system is implemented with one core on each FPGA board. On each board, the bit file includes the OpenSPARC core, the Xilinx MicroBlaze controller, memory controller, serial port, and the Aurora interface, which connects to the other board. Different software is run on the board, however. On the slave board, the firmware simply forwards memory requests to the master board. Memory on this board is mostly unused, with only a small part being used for the MicroBlaze code and data. On the Master board, the firmware processes all memory requests, from the local core, as well as the remote core. On this board, memory is partitioned with a small part being used for the MicroBlaze code, about half being used for the OpenSPARC memory space, and the other half being used for the OpenSPARC RAM disk image.
    The next question was about runtime scheduling of an executable. If the executable has only a single thread of execution, it will run on one core, one hardware thread, and cannot be partitioned between two cores, or even two hardware threads. If some mechanism has been used to create multi-threaded execution in the program (like explicit programming using pthreads, or maybe OpenMP), then at run-time, the operating system (OpenSolaris) will schedule the different threads of the program onto different hardware threads or different cores. If you try to run a program directly under Hypervisor, without an operating system, then all the partitioning would have to be done explicitly in the program itself.
    Hope this helps,
    formalGuy

  • Simulating a multi-processor machine

    Hi there,
    I am writing a server-like application and would appreciate some of the guru's advice.
    During the start up and running of this app, there are quite a few operations that could block the current thread. For example one of the start-up operations opens a socket. If the socket cannot be opened then it has to wait quite a while before throwing the TimeoutException.
    This gives the application a slow feeling to it. (Not that any of GUI thread stuff is blocking, just the data comes through slowly).
    Now I do know about Threading, and I can go that route quite easily, however I am not keen on the thread creation overhead (+-20k memory for each thread, even though most of the tasks are incredibly short lived)
    What I am interested in is a hybrid approach. I was thinking of simulating a multi-processor machine. This would entail have a fixed number of Threads, and sending them work as the tasks arrive.
    However to coordinate these threads, will require a fair amount of synchronized code, so I am not sure if it worth it.
    Has anyone tried such an approach, or have any ideas about this?
    Many thanks
    -Philip.

    Sorry about the double post,
    please ignore this thread.
    Wish there was a way for me to delete
    this thread...
    <Prays to Java Gods>

  • Multi-Processor Systems vs Single Processor systems

    In general, is it better to run Weblogic on a fast single processor system
    or on a multi-processor system where the individual cpus are less powerful?
    I am assuming that the platforms are WINTEL and all other things (memory,
    disk channels etc) are equal.
    What are the licensing implications of one philosophy over the other?

    Jim Ewing wrote:
    >
    In general, is it better to run Weblogic on a fast single processor system
    or on a multi-processor system where the individual cpus are less powerful?
    I am assuming that the platforms are WINTEL and all other things (memory,
    disk channels etc) are equal.You'll hate me for saying this, but it depends on your application and
    your client load.
    I'd suggest that you run a load test against both systems and compare
    the results.
    >
    What are the licensing implications of one philosophy over the other?You pay for WLS by the number of CPUs.
    -- Rob
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • CPU time from a multi processor

    Hi
    I need to get the CPU time from a multi processor machine,
    The top command will not do the job for me, and I will need to use the command in automation for testing the CPU time for 2 hours or more, I thinking about redirect the CPU % to a file, and in the end I will run the average for the numbers in that file.
    If I will be able to see the CPU time for the two processors it will be grate, but more important is to collect the global CPU status.
    I don�t have a command line that a can use, I can use some help.
    Thanks Shay

    mpstat in fact works on my Opteron 270 dual-processor dual-core machine running Soalris 10. For instance 'mpstat 3 5' displays 5 reports each 3 seconds apart, showing status of each CPU:
    % mpstat 3 5
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 1 0 1 383 245 73 0 5 0 0 87 1 0 0 99
    1 1 0 1 33 4 51 0 4 0 0 57 0 0 0 99
    2 0 0 1 38 0 72 0 2 0 0 42 0 0 0 100
    3 1 0 1 53 26 49 0 1 1 0 47 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 393 252 76 0 8 0 0 94 1 0 0 99
    1 0 0 0 48 4 82 0 7 1 0 71 0 0 0 100
    2 3 0 0 39 0 76 0 4 1 0 51 0 0 0 100
    3 0 0 0 44 25 35 0 3 2 0 49 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 382 250 64 0 5 0 0 111 0 0 0 100
    1 0 0 0 29 4 43 0 4 0 0 56 1 0 0 99
    2 0 0 1 48 1 93 0 3 0 0 39 0 0 0 100
    3 0 0 0 69 29 78 0 1 1 0 65 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 1 386 250 72 0 4 0 0 111 0 0 0 99
    1 0 0 0 28 3 42 0 3 0 0 55 1 0 0 99
    2 0 0 0 42 0 81 0 1 0 0 43 0 0 0 100
    3 0 0 0 67 29 74 0 0 1 0 63 0 0 0 100
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 0 0 0 404 252 98 0 5 0 0 100 1 0 0 99
    1 0 0 0 45 9 68 0 5 1 0 53 0 0 0 100
    2 0 0 0 34 0 64 0 4 0 0 50 0 0 0 100
    3 0 0 0 58 27 60 0 2 2 0 73 0 0 0 100
    (The first report summarizes all activity since boot.)

Maybe you are looking for