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>

Similar Messages

  • Performance problems on multi processor machine

    Hi,
    we are using a software written in Java (as Servlets using Tomcat 4.1.29) 1.4, which has a very poor performance. Sadly we don't have the source-codes for the application, but from the log-files we can figure out, that there is a very strong overhead, when changing the processors; that means i.e. when changing from processor 1 to processor 2 a statement which usually only needs 50ms, takes around 20 secs to finish. That could not be....
    Do you have any suggestion, maybe about the parameters which are used to start java?
    We use the following startup-properties:
    -d64 -server -Xms1G -Xmx2G -Xmn800m -XX:+DisableExplicitGC -XX:+UseParallelGC -verbose:GC -Djava.awt.headless=true
    Thanks for your help,
    Anton

    Before anyone answers this, check out what was already attempted at his stinkin' CROSSPOST:
    http://forum.java.sun.com/thread.jsp?thread=553113&forum=54&message=2706725

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

  • 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.)

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

  • Multi-Processor Performance

    I would like to know what performance gains I might expect from moving our
    weblogic application server to a multi-processor machine. Will 2 processors
    handle twice server the load of the one processor machine?
    Platform: Solaris 2.6
    Weblogic Server: 4.5.1 SP7
    NativeIO enabled
    Weblogic Server is the only thing running on the machine.
    Other Questions:
    1. Is there anything that needs to be done(other than purchase another
    license) for the weblogic server to work on a multi-processor system?
    2. Will the weblogic server naturally take advantage both processors?
    3. Will performance gains be uniform or will certain features gain more
    from multiple processors?
    Any links or suggestions are appreciated.
    thanks,
    Jeremy

    Hi Jeremy -
    If you are interested in modeling this before implementing it to determine
    performance gains, you might want to check out our scalability assessment
    services description, see attached. We are a BEA Technology Alliance Partner
    that specializes in answering those specific performance questions, and have
    done that for a number of clients in the past few weeks.
    (See also eQASEsheet2.pdf) - this describes our capacity sizing tool that works
    particularly well for Weblogic.
    Todd
    jeremy wrote:
    I would like to know what performance gains I might expect from moving our
    weblogic application server to a multi-processor machine. Will 2 processors
    handle twice server the load of the one processor machine?
    Platform: Solaris 2.6
    Weblogic Server: 4.5.1 SP7
    NativeIO enabled
    Weblogic Server is the only thing running on the machine.
    Other Questions:
    1. Is there anything that needs to be done(other than purchase another
    license) for the weblogic server to work on a multi-processor system?
    2. Will the weblogic server naturally take advantage both processors?
    3. Will performance gains be uniform or will certain features gain more
    from multiple processors?
    Any links or suggestions are appreciated.
    thanks,
    Jeremy--
    Todd Wiseman
    Dir/Business Development
    eQASE LLC
    (303)790-4242 x130
    (303)790-2816
    www.eqase.com
    Java Performance & Scalability
    [eQASE WLS Consulting Offerings.pdf]
    [eQASEsheet2.pdf]

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

  • Monitor multi processor

    hey all..
    how i can monitor each processor in my multi processor machine which have solaris 8 ..
    and if i create thread by using java language why i not see it in the prosess list by use PS command..

    Regarding question 1: try the "mpstat" comand...
    $ mpstat 3
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 177 7 145 149 35 781 44 104 50 0 462 15 11 13 61
    1 142 8 530 519 435 27 48 104 46 0 103 12 10 14 64
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 8639 0 2906 700 589 923 72 291 222 0 7232 18 50 1 30
    1 8659 0 2237 439 315 994 75 290 236 0 7370 20 52 3 25
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 8350 0 2641 685 578 853 69 273 198 0 10050 23 50 2 26
    1 8739 0 2353 491 313 1101 141 271 222 0 8423 21 51 1 27
    CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
    0 8991 0 2834 680 554 987 81 300 238 0 6952 19 51 0 30
    1 8825 0 2438 506 384 1013 80 293 237 0 7001 21 52 0 27

  • Multi processor utilization

    Hi,
    I have two questions.
    My multi-threaded server application utilizes more than 95%
    of the CPU under high load conditions. However on a dual
    processor machine the processor utilization does not cross
    70% under high load conditions. The load is simulated by
    a test environment that can pump in as much load as is desired
    and has no limitation.
    My second question is, does SUN document the maximum amount of
    data that a SUN machine can read/write per second from its ethernet
    internet. If yes, where can I find this information.
    A quick reply with copy to [email protected] is very very appreciated.
    Regards,
    PK

    Interesting to me too . .
    I read on the FCP forum that FCP 5.0.4 only uses two processors. The poster was asking whether the universal upgrade was modified to use all four on a quad - or whether it was for the new Intels only.
    Funny how you only find this stuff out AFTER you've spent a fortune on the latest hardware!
    Andy

  • 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

  • Media Encoder not multi-processor capable?

    I checked the preferences. Don't see any options to enable
    multi-processors. Jobs take forever but they could be going a lot
    quicker if they used the full potential of the hardware.
    Media Encoder CS4 Version 4.0.0.374
    Load average is 1.12
    CPU idle is at 85%
    The jobs are not being distributed at all.

    Here is a shot of my Machine running a 2 hour encode on Media Encoder, notice that one processor is completely maxed out while the other one is completely idle...

  • Interrupt in a multi-cpu machine

    Hi,
    I want to know how the interrput is dealed in a multiprocessor environment. Anyone can tell me or point me to the doc. to check?
    Will interrupt be sent to different CPU equally or they are given to one default CPU?
    Thanks!
    Yong

    I've seen, however that most operating systems like processor affinity and
              won't go out of their way to spread threads across CPUs due to CPU cache
              synchronization expense. Running two WLS instances on a dual processor
              machine will give you more throughput.
              Mike Reiche <[email protected]> wrote in message
              news:3bcf1d58$[email protected]..
              >
              > You don't need two instances of WL to take advantage of two CPUs.
              >
              > Each WL instance in a cluster requires its own IP address. You can refer
              to them
              > by their IP address.
              >
              > Mike
              >
              >
              > "jyothi" <[email protected]> wrote:
              > >
              > >hi,
              > >if we need to plan a cluster on a multi-cpu machine..how does
              > >the installation of wls go..do we need to install two instances of WLS
              > >on the
              > >machine or do we have to install only one instance??
              > >
              > >also wrt wls6.0, through the admin console running on another machine..we
              > >create
              > >new entries for machine's first and then we create new servers .. how
              > >do we associate
              > >the two servers running on the same multi-cpu machine with the machine
              > >name??
              > >
              > >thanks
              > >jyothi
              >
              

  • Support Multi processor in ms windowsp

    Hi, looking for a new Mac but need to run windows programs such has @risk.
    my question is simple when running Windows using software such has Parallel would multi processor be supported?
    would it be supported if I reboot in Ms-windows, with Boot camp? In that second case it sound likely
    thanks

    If the OS and app suports multiprocessors then they can be used in both a virtual machine such as Parallels and is BootCamp. In Parallels you select how many cores yo want the virtual machine to use as well as how much memory.
    Windows XP home does not support multiple processors

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

  • 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

Maybe you are looking for

  • IPod recognised by windows, but not appearing in iTunes

    My sister recently bought an iPod nano so we have both been using the same computer, different user areas for our iTunes. However, there is some conflict between them somehow as now the iPod is not appearing in iTunes but is appearing as a hard drive

  • Wifi under windows 7 boot camp keeps dying

    I have been running windows 7 64 bit under Boot Camp for just under a week, and last night have started to have some pretty serious issues with the built in wifi. Periodically, without any consistent cause, when I am booted into Windows 7, my interne

  • HELP! flash error code #1065 variable TCMText is not defined

    Hi, Im doing a project for uni and trying to create a search bar throughout the flash document for people to find what they are looking for. Followed a tutorial online step by step and then i get this error. #1065 variable TCMText is not defined. I'm

  • Speed of processor is being limited by system firmware after BIOS update

    Hello, I have updated the BIOS of my G510 to the latest version, which is 3.09. But after this update, I have noticed "The speed of processor is being limited by system firmware" entries at the Windows System event log. They are like that: "The speed

  • Floating point performance

    Hi, I'm trying to investigate floating point performance on an iPhone device vs. using fixed point math. Does the iPhone have a FPU? Are there any papers in the developer iPhone reference library that talk about this subject ( I did a search but noth