Multiple threads on multiple processors

Hi
I am trying to write some code which will actually need to run on a multi processor machine with 14 CPUs
I do not want to use RMI so I am left with the option of Threads
As far as i know on a single processor the threads are time sliced and give you a feeling of parallelism and hence this is virtual parallelism, but what about a multiprocesor machine
Is it that each of the thread gets its own CPU and if it is so is this a rule or is it dependent on the OS and the JVM. Is there any way I can verify if the threads are actually running on differnt CPUs
any help on this is highly appreciated
regards
avinash

This all rather depends on the way your application is designed and implemented.
In theory, a VM running on a multi-processor machine can have as many active threads running in parallel as there are CPUs.
However, if your application runs in a single Thread then this can only run on one CPU, regardless of how many are available.
The system internal Threads, such as the GC thread can and do run where they are told to, especially if you can make use of concurrent GCing in jdk1.4.
You are going to have to look at the way you are solving the tasks at hand in your application.
Partitioning the problem so that you can subdivide things such that each partial problem can be solved in parallel, thus taking advantage of multiprocessor machines can be a difficult (in some cases impossible) task. If your application is meant to solve such a problem then you are in luck.
Example of an easily partitioned problem. Ray Tracing - you can divide up the problem area into sub-parts of the 3D model you want to render and each sub-part can be solved in parallel.
In any event, an application that runs in a single thread is not going to run any faster on a multiprocessor machine.

Similar Messages

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

  • Does PS CS6 take better advantage of multiple processors than PS CS5?

    Hi,
    According to the article on this Adobe Support page, it says: There is a law of diminishing returns with multiple processors- The more processors you use, the less you get from each additional processor. Therefore, Photoshop isn't necessarily four times as fast if you have four microprocessors. 
    My question is, is this part of PS improved in this new version? If anyone knows about this, your response would be greatly appreciated!
    Thank you in advance.
    Jung

    newalchemist wrote:
    So, do you mean that new PS can take "full" advantage of more than four threads now?
    Good question.  This was with a simple Image size (from 25,000 pixels square to 15,000 pixels square)
    Six cores, but only only six threads, maxing out at about 70%.  I helped itself to lots of RAM though.

  • Question On Multiple Processors

    I have a question I am hoping the gurus can clarify. I have an Ultra running two processors. Does the OS utilize both processors all the time (running OS functions and applications) or do the applications have to be specifically written to use multiple processors? Thank you in advance.
    -Jim

    Thank you Richard, that helps greatly. I guess I need to read up on multi-threading.
    Thank you,
    James Corrill
    Generally, if the OS has something to do and there is
    an idle processor, it will utilize the processor. If
    you have 10 processors and at least 10 things to do,
    all the processors can be kept busy. This could be 10
    unrelated programs or a single program that is
    designed to use at least 10 threads. Some of the
    things to do may also be running OS functions such as
    processing interrupts or handling TCP/IP.
    On the other hand, if you typically have just one
    single-threaded, cpu-intensive task to run, the second
    processor won't help much; and more processors
    probably won't help at all. In such a case, you would
    want to consider breaking the program into parallel
    processes or threads.
    Richard

  • JVM's suport for multicore processors and multiple processor systems

    Hi all,
    Do you have any concrete information about Sun Hot JVM 1.5's support for multi-core processors and also its support for multi processor systems. I ask this because i am looking at deploying a multi threaded application written in Java 5 and want to know the best CPU arrangement for optimal performance.
    Does JVM run itself on multiple CPUs?
    Does JVM run native threads on multiple CPUs ? at the same time.
    Is there a place where i can find out the exact behavior of the JVM in sus environments ?
    Thanks.

    Hi,
    Sun's JVM runs very well on multi-thread/core/chip systems and provides several mechanisms to scale well in such environments (for example Thread Local Allocation Buffers (TLABs), parallel gargabe collection threads etc.). Java threads are 1:1 mapped to operating system threads. There are lots of options that allow you to configure the JVM wrt number of gc threads and so on, although the defaults should in most cases work well. There is a lot information available at http://java.sun.com/docs/performance/index.html and some (quite outdated) information about threading at http://java.sun.com/docs/hotspot/threads/threads.html.
    Nick.

  • Multiple processors, or not!!

    I have just noticed that Aperture does not make use of more than one processor.
    I am unstacking just under 7,000 images and it's taking a while with only one core being used, at 100%!
    I know that people have been complaining of how slow Aperture can be, I am sitting here looking at three cores doing nothing!
    I've only got another 15,126 stacks to flatten uh!

    Some tasks are inherently serial by nature. Consider what it is that you're doing: Unstack stack-A, Unstack stack-B, Unstack stack-C,...
    Every one of those operations will have to be written to the database, and during all these writes, the database must protect itself against other write-operations corrupting its internal structure so it locks the database, writes the change, then unlocks the database. Repeat until every stack is unstacked.
    Locking the database for a write-operation prevents any other thread (ie: any other CPU) from concurrently accessing the database file (see http://www.sqlite.org/lockingv3.html for the gory details). So, whichever thread is currently doing the unstack operation has control of the database until it is finished. Ergo, no parallelism.
    That's not to say it couldn't be done better than it is, but I suspect core-data is the root of the problem. The Core-data framework provides a direct binding between the state of an object in the running application, and its state on disk. Change the value in memory (eg: set the orientation to 'landscape') and that value will magically be stored on-disk in the database.
    That strong-coupling of the application to its data-storage is very convenient for the programmer (in my little apps, it's great! but removes some of the flexibility that a larger app may require... For example: in pure SQL, Aperture could batch-up all the changes into one transaction (ie: take the lock, write 7000 changes, unlock the database). That's likely to be significantly faster than taking/releasing the lock each time.
    It's actually more complicated than that (Core-data has an intermediary layer to try and reduce the overhead I've been talking about), but I hope the gist of what I'm trying to explain is clear: some things just don't spread over multiple CPU's easily, in fact sometimes having more cores is actually a problem rather than a benefit, but that's a different story...
    FWIW, I see quite a lot of parallelism in Aperture - look at import for example, or whenever it renders images...
    -=C=-
    Mac Pro   Mac OS X (10.4.8)  

  • Is this a bug in BDB 4.7.25 for supporting multiple processors (CPUs)?

    Experts,
    We have an application using BDB4.7.25 version, and it is multiple threads architecture.
    When it runs on single CPU system, everything is ok.
    But when runs on multiple CPUs system, some strange things will show up. First we found that the "checkpoint" and "log_archive" functions will cause "Not enough space" error after long time run(2 or 3 hours), then the "db_stat" utility rejects to run with the error "Not enough space". And then we found that some APIs like "truncate(txn, 0, 0)" will report the same error by even running once.
    So can any experts give us some instructions here?
    Thanks

    I cannot get the exact error message from the output stream indicated with "set_err_stream", because this error seems not belong to any type of the following:
    DB_VERB_DEADLOCK
    DB_VERB_FILEOPS
    DB_VERB_FILEOPS_ALL
    DB_VERB_RECOVERY
    DB_VERB_REGISTER
    DB_VERB_REPLICATION
    DB_VERB_REP_ELECT
    DB_VERB_REP_LEASE
    DB_VERB_REP_MISC
    DB_VERB_REP_MSGS
    DB_VERB_REP_SYNC
    DB_VERB_REPMGR_CONNFAIL
    DB_VERB_REPMGR_MISC
    DB_VERB_WAITSFOR
    And the "db_stat -c" and "db_stat -m" will both return :
    db_stat: DB_ENV->open: Not enough space
    db_stat: dbenv->close: Not enough space
    We build the unitility and libraries using the same configurations.
    I use the "truss" tool to print out the call flow like below, it is too long and I just keep the last part.please let me know if the information is not enough:
    munmap(0xFF3A0000, 8192) = 0
    mmap(0x00010000, 24576, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFF3A0000
    getcontext(0xFFBFEBF0)
    getrlimit(RLIMIT_STACK, 0xFFBFEBD0) = 0
    getpid() = 2921 [2920]
    setustack(0xFF3A2088)
    sigfillset(0xFF16FB20) = 0
    stat("/platform/SUNW,Netra-440/lib/libc_psr.so.1", 0xFFBFE6A8) = 0
    resolvepath("/platform/SUNW,Netra-440/lib/libc_psr.so.1", "/platform/sun4u-us3/lib/libc_psr.so.1", 1023) = 37
    open("/platform/SUNW,Netra-440/lib/libc_psr.so.1", O_RDONLY) = 3
    mmap(0x00010000, 8192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_ALIGN, 3, 0) = 0xFF040000
    close(3) = 0
    sysconfig(_CONFIG_SEM_VALUE_MAX) = 2147483647
    sysconfig(_CONFIG_STACK_PROT) = 3
    sigaction(SIGHUP, 0xFFBFEE78, 0xFFBFEFD8) = 0
    sigaction(SIGINT, 0xFFBFEE78, 0xFFBFEF98) = 0
    sigaction(SIGPIPE, 0xFFBFEE78, 0xFFBFEF58) = 0
    sigaction(SIGTERM, 0xFFBFEE78, 0xFFBFEF18) = 0
    brk(0x00022330) = 0
    brk(0x00024330) = 0
    getpid() = 2921 [2920]
    sysconfig(_CONFIG_NPROC_ONLN) = 4
    open64("DB_CONFIG", O_RDONLY) = 3
    fstat64(3, 0xFFBFE7D8) = 0
    brk(0x00024330) = 0
    brk(0x00026330) = 0
    fstat64(3, 0xFFBFE680) = 0
    ioctl(3, TCGETA, 0xFFBFE764) Err#25 ENOTTY
    read(3, " s e t _ c a c h e s i z".., 8192) = 201
    read(3, 0x000231F4, 8192) = 0
    llseek(3, 0, SEEK_CUR) = 201
    close(3) = 0
    open64("__db.001", O_RDWR) = 3
    fcntl(3, F_GETFD, 0x00023228) = 0
    fcntl(3, F_SETFD, 0x00000001) = 0
    fstat64(3, 0xFFBFEDC0) = 0
    close(3) = 0
    open64("__db.001", O_RDWR) = 3
    fcntl(3, F_GETFD, 0x00023228) = 0
    fcntl(3, F_SETFD, 0x00000001) = 0
    mmap64(0x00000000, 32768, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xFEF30000
    close(3) = 0
    fstat64(2, 0xFFBFE828) = 0
    db_statwrite(2, " d b _ s t a t", 7) = 7
    : write(2, " : ", 2) = 2
    DB_ENV->openwrite(2, " D B _ E N V - > o p e n", 12) = 12
    : write(2, " : ", 2) = 2
    Not enough spacewrite(2, " N o t e n o u g h s".., 16) = 16
    write(2, "\n", 1) = 1
    db_statwrite(2, " d b _ s t a t", 7) = 7
    : dbenv->close: write(2, " : d b e n v - > c l o".., 16) = 16
    Not enough spacewrite(2, " N o t e n o u g h s".., 16) = 16
    write(2, "\n", 1) = 1
    _exit(1)
    Thanks very much

  • Utilizing Multiple-Processors in Classic Mode?

    I have four PPC based scientific programs that will only run in classic mode. They take hours to run each, and so I am considering purchasing a Power Mac G5 Quad (2.5 GHz) to do so. Question: Can I run the 4 programs simultaneously, and can I ensure that each one runs on a different processor so that I will get the desired performance increase? (I currently run the programs on an iMac G5, OS X 10.4.11, and can run them all together if I want - but that doesn't improve performance...).
    thanks,
    Photonic

    Apple made G4/500DP, 533DP, 800DP etc. And there are still cpu upgrades for pre-MDD models. The 1.42DP was the fastest made at the time, but not the only one, and not without some heat and noise issues.
    http://www.welovemacs.com/appoma.html
    http://www.welovemacs.com/g5machines.html
    http://www.welovemacs.com/m96.html
    http://www.welovemacs.com/g41gh80gb.html
    One report showed Classic running on G5.
    http://www.xlr8yourmac.com/G5/g5firstimpressions.html
    And for some applications, they aren't written to, or benefit from running on multiple cores. And Classic is probably just such an application. OS 9 was not known for being efficient at giving foreground and background apps more cpu cycles.
    Comparing cpu performance:
    Finding a way to run Classic efficiently on a current 2.8GHz 8-core Mac Pro?
    http://www.geekpatrol.ca/2006/08/mac-pro-3ghz-benchmarked/
    http://www.geekpatrol.ca/2006/12/eight-core-mac-pro-benchmarks/
    You said that right now it takes hours to run currently on your iMac G5. Your Intel iMac running @ 3GHz might be able to run SheepShaver, but the more I looked into it, the more iffy it seemed. But that would answer the question of whether you need to look at a new $1500 Quad G5, or invest in something else. or use your new iMac.
    http://www.barefeats.com/imp02.html
    http://www.macworld.com/article/133467/2008/05/imaccomparison.html
    SheepShaver - Although it took me a few days to get it up and running, in hindsight, SheepShaver was the easiest of the three to install and configure. This is due to the fact that, while it requires a ROM file like the others, this ROM file can be obtained from Apple installation CDs or update disk images available from their Web site. http://www.atpm.com/12.09/classic.shtml
    http://gwenole.beauchesne.info/en/projects/sheepshaver

  • Multiple processors in a single pxi

    Hello all,
    I would like to know if it is possible to use two or more outputs for several displays from a single PXI, with two independent opertaing systems in each. For example by inserting two CPU cards or something similar.
    Thanks in advance,
    Alex

    Alex,
    I assume you are coming from the VME/VXI world where this was possible and often used when more processing power was required. PXI's architecture is different in that it can only have one host PC for a given backplane. You can, however, have multiple PXI chassis and synchronize them over ethernet or other communication methods. LabVIEW 8's shared variable makes this type of configuration even easier.
    May I ask why you are hoping to use multiple hosts?
    Thanks,
    -Adam

  • ISCSI and TCP across multiple processors

    Can TCPIP balance between 2 processors on Netware 6.5 sp6 when using the
    iSCSI initiator.

    Hi,
    [email protected] wrote:
    >
    > Can TCPIP balance between 2 processors on Netware 6.5 sp6 when using the
    > iSCSI initiator.
    I don't think so, at least not in any noticeably way, as iSCSI is just a
    single thread (and doesn't make much sense to be multithreaded). As
    such, all, or virtually all iSCSI traffic will always go through the
    same CPU.
    Of course, the question is mot anyways, as iSCSI under no circumstances
    will ever be able to put any serious load even on a single modern CPU.
    CU,
    Massimo Rosen
    Novell Product Support Forum Sysop
    No emails please!
    http://www.cfc-it.de

  • Re: Multiple Processor-Objects

    I found some h263 encoded media files on http://samples.mplayerhq.hu/V-codecs/h263/
    and even used the exact same file for the concat-sample - with the following result:
    - Create processor for: file://XXX/movies/movie10.mov
    - Create processor for: file://XXX/movies/movie10.mov
    - Cannot transcode the tracks to a common format for concatenation!  Sorry.
    Failed to match the tracks.
    Failed to concatenate the inputs
    Could someone perhaps offer media-sample that are guaranteed to work with at least that concat-example?
    Edited by: Yppolitia on Feb 4, 2010 8:13 AM

    H.263 encoding is only supposed by the performance packs, so if you're using the cross-platform pack you won't be able to encode H.263.
    For samples, I generally use these:
    [http://www.cs.odu.edu/~cs778/spring04/lectures/jmfsolutions/clips/]

  • Scalability to Multiple Processors and Faster Processors

    To what degree do Final Cut Studio's compute-intensive operations, such as rendering video or creating DVD content, scale by number of processor or clock rates of those processors.
    More to the point, to what degree would I expect going from a dual 2GHz G5 machine to a quad (i.e., dual, dual-Pentium) 3GHz machine to approximately triple the throughput of such operations?
    Thanks for the ideas!

    I see some benchmarks on Apple's website regarding the new 8-processor Xeon machines.

  • Multiple Processor

    I have installed oracle report server on a machine having 4 processor's. how can i benefit from all of these processors to finish the job fast.

    H.263 encoding is only supposed by the performance packs, so if you're using the cross-platform pack you won't be able to encode H.263.
    For samples, I generally use these:
    [http://www.cs.odu.edu/~cs778/spring04/lectures/jmfsolutions/clips/]

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

  • Issues with form fill by multiple processors

    Hi,
    To put in simple words the scenario is something like this:
    I have an interactive form with one field (field1). When the user submits this form it will start a Guided Procedure. Lets call this as Form1.
    In the first action of the guided procedure, I am creating another interactive form with field1 and a new field (field2) and sending it by mail to the processor. This guy downloads the form, enters a value in field2 and submits back to GP. Lets call this is as Form2. (I am mapping field1 of form1 to field 1 of form2).
    The next step is a RFC callable object which takes these 2 fields as input.
    At first I tried to take both the fields from Form2 and map to the action of RFC callable object.. then I got errors (cannot handle text/html.. probably because GP engine was trying to throw some errors in HTML) while submitting the form2.
    Then I tried to take field1 from form1 and field2 from form2... still got the same error.
    Then I tried to assign default value to field1, still got the same error.
    When I did not map field1 at all, the submission of form2 worked. However, my RFC failed (obviously).
    How can handle this situation? How can I see the errors that GP is tryinig to throw? defaultTrace.trc log is not showing any errors.
    Thanks
    Ram

    Hi Ram
    You can activate all type of GP messages in 'defaultTrace.trc'. Sometimes important thing is not an Error. Go to Visual Admin -> Services -> Log Configuration -> Locations, enable Advanced Mode, go to location 'com/sap/caf/eu/gp' and switch over a severity on it from Error to All.
    BR
    Sergei

Maybe you are looking for

  • Spell check broken after IOS 6.0.1 update

    After updating one of our iPads to 6.0.1 the spell checking no longer works.  All of the settings (under keyboard) relating to spell checking, capitalization, "." are ON but none of these features work in any program.  I powered off the iPad and rest

  • How do I install the font ITC Bailey Sans in Adobe CS4 on a PC?

    How do I install the font ITC Bailey Sans in Adobe CS4 on a PC? I was given the font files on a CD but the file type for each font is not recognized. Any insight would be greatly appreciated. Thanks.

  • R/3 users Authntication to LDAP?

    Hello, I have configured the LDAP Conenctor using Tx LDAP from R/3 4.7 running on AIX Server to MS-ADS LDAP Server. After making all the settigns i have run the report RSLDAPSYNC_USER for synchronizing the users between R/3 amd LDAP. Then the Users a

  • How do I add content to my iphone using itunes?

    I have watched the tutorial, and I know that once my iphone is plugged in, it shows up in itunes, I should be able to click on that, and then choose "add to" and simply drag and drop items onto my iphone.  However, the "add to" button just will not s

  • Computer cleaned sync key gone?

    So i took my chances-played with fire.the firefox auora build is amazingly fast and awesome yet the 7.02 update was HIGHLY unstable and caused windows to go into a permanent lock-down the only way i could get to a stable environment was to reinstall