How many Threads on a given system ?

Is there a way to know for an AIR application how many threads a given system system supports?
Pixel Bender is capable of real multi threading. It would not make sense to run 4 instances on a system with only 2 threads, but would be a shame not to utilize all threads of an 8 core hyper threading system.
Thanks,
David

This appears to be a Flex question. Please try the flex forums http://forums.adobe.com/community/flex/flex_general_discussion

Similar Messages

  • How many  threads are running?

    here's the code... i am trying to understand, at each point, how many threads are running:
    I understand that one thread belongs to the caller of the start()
    & at the same time there is another thread belonging to the instances of each thread (thread1, thread2, thread 3 etc.)
    1public class ThreadTester {
    2   public static void main( String args[] )
    3   {
    4      PrintThread thread1, thread2, thread3, thread4;
    5
    6      thread1 = new PrintThread( "thread1" );
    7      thread2 = new PrintThread( "thread2" );
    8      thread3 = new PrintThread( "thread3" );
    9      thread4 = new PrintThread( "thread4" );
    10
    11      System.err.println( "\nStarting threads" );
    12
    13      thread1.start();
    14      thread2.start();
    15      thread3.start();
    16      thread4.start();
    17
    18      System.err.println( "Threads started\n" );
    19   }
    }can you tell me if i am counting the number of threads in existance correctly...
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1.........1.......2
    14..............1+1......1+1.....4
    15..............2+1......2+1.....6
    16..............3+1......3+1.....8
    so by the time line 16 executes i have a total of 8 threads,
    4 threads belonging to each caller plus
    4 threads created by start()
    or is it
    LINE#.....CALLER...START...TOTAL THREADS
    13..............1........1........2
    14..............1........1+1.....3
    15..............1........2+1.....4
    16..............1........3+1.....5
    after line 16 executes does the caller thread die, thus leaving only a total of 4 threads?
    there is only one thread belonging to the caller at line 13(plus the thread it creates).
    at the start of line 14, the previous callers thread is dead & now a new thread is created that belongs to the caller on line 14... etc.

    well, i realize at the end there would be 4 threads but im trying to get my head around this explanation in the book:
    "A program launches a threads executioin by calling the threads start method, which in turn call the run method. After start launches the thread, start returns to tis caller immediately. The caller then executes concurrently with the lauched thread." there fore if i have 2 concurrent processes, are there 2 threads running????
    now having said the above, my question was:
    for each line,
    how many threads are in existance at
    line13
    line14
    line15
    line16
    thanks.

  • How Many Threads inside JVm while running

    Hi,
    how many threads will be there in jvm of 1.4 or higher sdk? threads i mean it includes all jvm threads also.

    How do you identify these threads?
    I can see 8 threads in my 1.5 java process (just running a main) using windows XP task manager, but when I check how many threads there are from within the code, it only looks like 4:
    java.lang.ThreadGroup[name=system,maxpri=10]
    Thread[Reference Handler,10,system]
    Thread[Finalizer,8,system]
    Thread[Signal Dispatcher,9,system]
    java.lang.ThreadGroup[name=main,maxpri=10]
    Thread[main,5,main]
    For example, using
    Thread.currentThread().getThreadGroup().getParent().list();

  • How many threads can be running at the same time

    Hi!!
    Dows anyone knows how many Threads can be running at the same time in the JVM.
    I'm making a multi thread client-server app and I would like to know how much simultneous connections the JVM support. I'm using one Thread per connection.

    Hi, thanks to all for your answers.
    I think that I made the wrong question, as you said: "that means the number of threads currently created".
    I'm worry about this because my application is already online (It's a mail server -SMTP and POP3 server using ORACLE for the users database- ) and some other user post in the "multi-tread forum" that almost any JVM can only have 700 threads created at the same time, and I've never heard or read anything about this.
    what you mean with the stack space (memory??)
    I'm using the JavaWebServer 2.0 and a servlet to start the main Thread.
    Again Thanks to all for the answers but I think that the schapel answer is the one that solve my doubt...

  • How many thread can I create?

    I wrote a multithread program. I use Excutors class and newCachedThreadPool method to create a thread pool.
    I want to create max threads that i can. In some where, I saw Max thread that is allowed, depends on OS, availabe memory, JVM.
    I use SUSE 11.1 as operating system, have 3.75 GB RAM & 7.5 GB swap & use jdk 1.6
    I want to create max threads that i can. I don't know how many i can create.
    please help me.

    Hi _Security, Mutli-Threading isn't always a good thing, because of the constant switching the processor has to do, causing it to be slower then it could be if you properly queued your tasks instead of threading each one. Each thread you create is another thing your processor has to execute each cycle, so if you have tons of threads, your processor will have to execute and switch through each one every cycle, making it bog down performance by a long shot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need FM/BAPI to get how many line items per given FI document...

    Hello Experts,
    IS there an available FM or BAPI to get how many line items there is for a given
    FI document? We are avoinding BSEG because of the performance.
    Hope you can help me guys. Thank you and take care!

    Hi,
    Not sure if there is a specific FMs or BAPIs whose specific purpose is to just count FI document lines. But you can use a number of FMs to read an FI document.
    i.e. FI_DOCUMENT_READ - pass the document keys (BUKRS, BELNR, GJAHR) and retrieve the T_BSEG table to get the document lines. Then you can just use DESCRIBE statement to get the number of lines in T_BSEG.
    Also, based on experience, I never had any problems with BSEG as long as I am providing the complete keys for an FI document (BUKRS, BELNR, GJAHR). But if you are trying to avoid BSEG, you can use the secondary index tables like BSIS , BSAS, BSAD, BSID, BSIK, BSAK to improve performance.
    Regards,
    Oscean Tortona

  • How many threads can be created in a java swing program?

    At first, I intend to use Timer to create a 2D plot repeatedly after a certain number of milliseconds. This is for an animation. However, I discover that it takes a lot of time to generate each 2D plot frame ( about 700 milliseconds on a 1.13 MHz computer, this is a complicated plot requiring a lot of computations). So I think I should use SwingWorkers, that means a new thread for each generated graph image. There might be 1000 images to be created, and thus there might be thousands of threads in my programs. I would like to know if there is any limitation on the number of threads generated in a program so that it will be safe, or is it ok to generate as many threads as you want, as long as you follow strictly the syntax of creating threads?
    I would be thankful if someone can give me some advice.

    as there is no restriction in the Language Specification (http://java.sun.com/docs/books/jls/second_edition/html/memory.doc.html#28457) i would think it's theoretically indefinit. of course, it has a maximum because of your memory. ;-)

  • How many threads are used to load an webpage in webview?

    I implemented a custom version of cookiemanage to overcome the problem of cookies being stored retrived in the same place for webview (when assigning a custom cookiemanager to default cookiehandler before initializing webview ).
    This custom class uses thread local to create a new store for each thread, so i could have varius webview instance not using the same cookiestore.Well, it doesn´t work because
    webview apperantly creates about 20 threads for loading (login) a webpage.I´m guessing webview uses several threads to load an webpage, because in my custom implementation of cookiemanager each thread that request
    CookieHandler.getdefault() get a new cookie store, i did this with threadlocal.
    My question to the experts is ::
    - Is my teory correct and weview creats several threads to load a page or i´m missing something where?
    - Also having my problem is there an way i can restrict webview so it only creates one thread or at least only one thread that call cookiemanager.getDefault()?
    Even not knowing the answers to the above , any details on webview inside working relating thread could be helpfull.
    Many Thanks
    André

    To print all Threads;
    class Equitus {
        public static void main(String[] arg) {
            new Equitus().run();
        public void run() {
            ThreadGroup tg = Thread.currentThread().getThreadGroup();
            for(ThreadGroup parent; (parent=tg.getParent()) != null; tg=parent) ;
            Thread[] threads;
            do {
                threads = new Thread[tg.activeCount()];
            } while (tg.enumerate(threads)!=threads.length);
            System.out.println(java.util.Arrays.toString(threads));
    }

  • Find out how many threads in a Java program

    Why do I get ID 20, ID 21, ID 22 by runing the following code? I would like to know if i acturely create a thread then stop it probably. somehow i need to call it two more times in my program.
    start() and interrrupt() are default thread methods. when I call start() it goes to my run() method. I am worry about if the thread 20 and 21 are still doing something after creating thread 22
    main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;
            main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;
            main = new Thread(this);
            System.out.println("ID " + main.getId());
            main.start();
            main.interrupt();
            main = null;

    Here is my code, I would like to know if I implement my threads nicely here, I am worrying those threads are still alive, they should be interrupted. but why I got different thread ID, when i resume it?
    // Two player board game play in turn. Human plays first as red, the computer plays
    // second as blue. I used thread here for repainting the applet, because the computer
    // evaulation function is quite slow, the gui won't draw human player's move until it
    // finishs calculating computer's move. the solution i use is interrupting the current
    // thread, let the gui repaint before calculating the computer move.
    // Board.java
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Board extends Canvas implements Runnable, MouseListener {
        private Thread main;
        private int state = 0;
        private double aMove = 0;
        public void init() {
            addMouseListener(this);
        public void run() {
            removeMouseListener(this);
            main.interrupt();
            main = null;
            repaint();
            // calculate computer's move, then making move
            // this is a slow evalution function goes here
            for (int i = 0; i <10000000; i++) {
                aMove = Math.pow(0.1,1000000000);
            state = 1;
            repaint();
            System.out.println("Blue makes a move on postion " + aMove);
            state = -1;
            addMouseListener(this);
        public void paint(Graphics g) {
            System.out.println("paint");
            if (state == 1) {
                g.setColor(Color.blue);
                g.fillOval(0, 0, 20, 20);
            if (state == -1) {
                g.setColor(Color.red);
                g.fillOval(0, 0, 20, 20);
        public void mouseReleased(MouseEvent e) {
            // human player makes a move on postion 0;
            aMove = 0;
            System.out.println("Red makes a move on postion " + aMove);
            state = -1;
            repaint();
            // Why the following gives me different thread here every time?
            main = new Thread(this);
            System.out.println("Thread ID: "+ main.getId());
            main.start();
        public void mousePressed(MouseEvent e) {
        public void mouseEntered(MouseEvent e) {
        public void mouseExited(MouseEvent e) {
        public void mouseClicked(MouseEvent e) {
    // appletdemo.java
    import java.applet.*;
    import java.awt.*;
    public class appletdemo extends Applet{
        Board b = new Board();
        public void init() {
            System.out.println("start ");
            setLayout(new BorderLayout());
            this.add(b);
            b.init();
            setVisible(true);
    }

  • How many scripts (as in writing systems) are supported by InDesign?

    I am trying to find a definitive list of scripts (as in writing systems) supported by InDesign. Is that available somewhere? These are the scripts I am interested in:
    Arabic
    Armenian
    Bengali
    Braille
    Canadian Syllabics
    Chinese
    Cherokee
    Cyrillic
    Devanagari
    Ethiopic
    Georgian
    Greek
    Gujarati
    Gurmukhi
    Hebrew
    Japanese
    Kannada
    Khmer
    Korean
    Lao
    Latin
    Malayalam
    Mongolian
    Myanmar
    Oriya
    Sinhala
    Tamil
    Telugu
    Thai
    Tibetan

    Yeah, I do understand that Ge'ez/Ethiopic script covers many languages - but quite a few East African minority languages written in Ge'ez that are not Amharic or Tigrinya use forms/"houses"/etc. not in the Unicode spec. The same is true of minority languages in Myanmar - don't assume you can typeset Karen once you have "Myanmar" in your list of supported languages!
    When you say "out of the box" do you really mean that? Most of the languages in that list that will work without plugins etc. require specialized fonts. The glyph coverage of the fonts that Adobe gives away with ID or the Creative Suite is extensive, but won't include most of your required languges. But, assuming you already have the fonts, and assuming that you know where to find the World-Ready Composer, then anything in that list that is not right-to-left (or vertical) should at least render correctly in ID. Mind you, "render correctly" doesn't help you if your Burmese translator doesn't key in zero-width spaces, for example.
    I think that this may well be why there is no Adobe master-list of supported languages that is easy to find; it's because It Is A Very Complicated Issue. I've been doing typesetting in a list of languages much like yours for the last decade, and even if Adobe's type rendering engine handles fonts-built-according-to-Unicode-spec (e.g. Lao), there is significant variation in font development techniques, font modification by people writing in minority languages, keying order, and personal translator keying preferences. But if you find that list, post it! I will be surprised, but not shocked, if it exists somewhere.

  • Ejb calling ejb, how many threads?

    A few of questions regarding the way WLS threads EJBs:
    1. It seems straightforward if I deploy a WLS "application" that's composed of
    a single EJB. I suppose that the app runs as a thread within the WLS JVM and "pooling"
    also makes sense.
    2. But what about an "application" that's composed of 2 EJBs, one calling the
    methods of the other. Is each EJB ran in its on thread? It seems like they would
    have to be in order to "pool" them or does the "pooling" affect the entire "application",
    i.e. you don't pool the individual beans but the entire app?
    3. How is all this affected by using local interfaces for the EJB-to-EJB method
    calls?How does this affect pooling and threading within WLS?
    Thanks.

    Hi Jack,
    "Jack Ottofaro" <[email protected]> wrote in message
    news:[email protected]..
    A few of questions regarding the way WLS threads EJBs:
    1. It seems straightforward if I deploy a WLS "application" that'scomposed of
    a single EJB. I suppose that the app runs as a thread within the WLS JVMand "pooling"
    also makes sense.It just seems because you have the question number two :)
    2. But what about an "application" that's composed of 2 EJBs, one callingthe
    methods of the other. Is each EJB ran in its on thread? It seems like theywould
    Actual EJB code runs within a thread that first began
    processing of the request. So you may have two cases.
    First, if the bean is colocated (belongs to the same jar
    or ear) with the caller, by default it will be a local call
    and the bean will run within a caller thread. Second,
    if it's remote call, it will run within "its own" thread.
    have to be in order to "pool" them or does the "pooling" affect the entire"application",
    i.e. you don't pool the individual beans but the entire app?I'm not sure I understood the question.
    3. How is all this affected by using local interfaces for the EJB-to-EJBmethod
    calls?How does this affect pooling and threading within WLS?Local interfaces buys nothing but mess. By default all calls to
    the beans residing in the same application , even if they are
    declared as EJBObjects, are optimized to be local so that
    parameters are passed by reference and are not subjects of
    serialization.
    Hope this helps.
    Regards,
    Slava Imeshev

  • Downloading package with pacman, how many threads?

    When I download packages with pacman it start at slow speed and then goes up,  this produces some kind of delay between downloads, especially for lots of small packages. I know this can feel like not a big problem, but you know, comparing with yum centos it seems kinda slow, seems like pacman download packages 1 thread at a time while yum it is like multi threaded because every package is downloaded consequentially without speed loss. Is there somekind of tweak for this?
    Last edited by natostanco (2012-04-28 10:16:13)

    There's a nice entry in the wiki about this, although I'd use Xyne's pm2ml instead of powerpill-light.  https://wiki.archlinux.org/index.php/Im … oad_Speeds http://xyne.archlinux.ca/projects/pm2ml/

  • How many threads used by EventDispatcher?

    Hi,
    I have a number of clients inserting entities to Coherence 3.5.3 distibuted cache. The cache has thread-count=10. On the cache I have MapListener which asynchronously invoked on entity insertion and process it further. It looks like only one thread is used for insertion processing (DistributedCache:DistributedCache-Message:EventDispatcher). And, under heavy load, I see some insertion events are lost. (This issue desribed by Patric Peralta in his blog a bit: http://blackbeanbag.net/wp/2009/07/20/coherence-3-5-service-guardian-deadlock-detection/). is it possible to manage/increase a number of event processing threads and prevent throttling of events?
    My cache config, just in case:
    <distributed-scheme>
    <scheme-name>distributed-message-scheme</scheme-name>
    <service-name>DistributedCache-Message</service-name>
    <serializer>
    <class-name>com.tangosol.io.pof.ConfigurablePofContext</class-name>
    <init-params>
    <init-param>
    <param-type>String</param-type>
    <param-value>pof-config.xml</param-value>
    </init-param>
    </init-params>
    </serializer>
    <listener>
              <class-scheme>
                             <class-name>spring-bean:messageMapCoherenceListener</class-name>
                   <init-params>
                   <init-param>
                   <param-name>setCacheName</param-name>
              <param-type>java.lang.String</param-type>
         <param-value>{cache-name}</param-value>
    </init-param>
                   </class-scheme>
    </listener>
    <backing-map-scheme>
    <read-write-backing-map-scheme>
    <internal-cache-scheme>
    <local-scheme>
         <expiry-delay>30s</expiry-delay>
         <flush-delay>30s</flush-delay>
                                       <high-units>512</high-units>
                                       <unit-calculator>BINARY</unit-calculator>
                                       <unit-factor>1048576</unit-factor>
    </local-scheme>
    </internal-cache-scheme>
    <cachestore-scheme>
    <class-scheme>
                                  <class-name>spring-bean:msgCacheStore</class-name>
    <init-params>
    <init-param>
    <param-name>setCacheName</param-name>
    <param-type>java.lang.String</param-type>
    <param-value>{cache-name}</param-value>
    </init-param>
    </init-params>
    </class-scheme>
    </cachestore-scheme>
    <rollback-cachestore-failures>true</rollback-cachestore-failures>
    </read-write-backing-map-scheme>
    </backing-map-scheme>
    <thread-count>10</thread-count>
    <autostart>true</autostart>
    </distributed-scheme>
    Thanks, Denis

    Hi Denis,
    We do not have a mechanism to process map events in multiple threads. I would suggest using the Java 1.5 Executor service (http://download.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Executor.html) and dispatch processing to a thread pool in your MapListener implementation.
    Thanks,
    Patrick

  • Upgraded to FF4 now it keeps telling me to reboot for upgrade to go into effect, regardless of how many times i reboot the system

    Went to upgrade to FF4 upgraded, and it told me to re boot the system to complete installation. Clicked to confirm reboot and screen closed down. PC chose that moment to have a power failure and when I switched it on again, I'd lost firefox and now every time I try to load firefox, the box comes up telling me to reboot the system to complete installation. When I reboot, nothing happens, it's like it's locked in a loop. curently cannot access any version of Firefox.
    I need to preserve my bookmarks and remembered passwords, otherwise I'd uninstall and reinstall from scratch. what can I do?

    Try rebooting the computer, do NOT open Firefox and then try the clean reinstall.
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!

  • How many of my home computer systems can I add this to?

    I am looking to upgrade to the Lion. I have 2 computers one laptop, one home can I purchase this once and share with both computers?

    Yes. 
    Captfred

Maybe you are looking for