Spawn loops at runtime

Hi,
I want to program a timed loop that spawns new parallel processes (e. g. while loops) at specific points in time. It's kind of a C++ loop that dynamically creates thread objects at certain interation points and calls the thread member function start() immediately. The loop can continue iteration after spawning a thread, regardless of the threads runtime.
At the moment placing a number of LabView while loops that are waiting for a start signal (via notifier or queue) from a main loop is the best way I can think of. But this approach is fixed in number.
Is there something I can do via VI references?

I managed it to open and call two instances of the same VI (CallMe.vi). These two instances get different input values (Wait Time). The CallMe.vi block diagram shows a double run arrow instead of a simple white arrow and both CallMe.vi instances terminate at different times according to their different Wait Time input values. I had to check "invariant execution" in the CallMe.vi VI settings.
Is this a or the correct way to dynamically call different instances of the same VI or various VIs without having to wait for their termination?

Similar Messages

  • Running java process in a while loop using Runtime.exec() hangs on solaris

    I'm writting a multithreaded application in which I'll be starting multiple instances of "AppStartThread" class (given below). If I start only one instance of "AppStartThread", it is working fine. But if I start more than one instance of "AppStartThread", one of the threads hangs after some time (occasionaly). But other threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside another thread?. Here I'm executing the process in a while loop.
    2. Other thing i noticed is the Thread is hanging after completing the process ("java ExecuteProcess"). But the P.waitFor() is not coming out.
    3. Is it bcoz of the same problem as given in Bug ID : 4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock. "
    I'm running this on sun Solaris/java 1.2.2 standard edition. If any of you have experienced the same problem please help me out.
    Will the same problem can happen on java 1.2.2 enterprise edition.?
    class AppStartThread implements Runnable
    public void run()
    while(true)
    try
    Process P=Runtime.getRuntime().exec("java ExecuteProcess");
    P.waitFor();
    System.out.println("after executing application.");
    P.destroy();
    P = null;
    System.gc();
    catch(java.io.IOException io)
    System.out.println("Could not execute application - IOException " + io);
    catch(java.lang.InterruptedException ip)
    System.out.println("Could not execute application - InterruptedException" + ip);
    catch (Exception e)
    System.out.println("Could not execute application -" + e.getMessage());

    I'm writting a multithreaded application in which I'll
    be starting multiple instances of "AppStartThread"
    class (given below). If I start only one instance of
    "AppStartThread", it is working fine. But if I start
    more than one instance of "AppStartThread", one of the
    threads hangs after some time (occasionaly). But other
    threads are working fine.
    I have the following questions:
    1. Is there any problem with starting a Thread inside
    another thread?. Here I'm executing the process in a
    while loop.Of course this is OK, as your code is always being run by one thread or another. And no, it doesn't depend on which thread is starting threads.
    2. Other thing i noticed is the Thread is hanging
    after completing the process ("java ExecuteProcess").
    But the P.waitFor() is not coming out.This is a vital clue. Is the process started by the Runtime.exec() actually completing or does the ps command still show that it is running?
    3. Is it bcoz of the same problem as given in Bug ID :
    4098442 ?.
    4. Also java 1.2.2 documentation says:
    "Because some native platforms only provide limited
    ed buffer size for standard input and output streams,
    failure to promptly write the input stream or read the
    output stream of the subprocess may cause the
    subprocess to block, and even deadlock. "These two are really the same thing (4098442 is not really a bug due to the reasons explained in the doc). If the program that you are exec'ing produces very much output, it is possible that the buffers to stdout and stderr are filling preventing your program from continuing. On Windows platforms, this buffer size is quite small (hundreds of characters) while (if I recall) on Solaris it is somewhat larger. However, I have seent his behavior causing problem on Solaris 8 in my own systems.
    I once hit this problem when I was 'sure' that I was emitting no output due to an exception being thrown that I wasn't even aware of - the stack trace was more than enough to fill the output buffer and cause the deadlock.
    You have several options. One, you could replace the System.out and System.err with PrintStream's backed up by (ie. on top of) BufferedOutputStream's that have large buffers (multi-K) that in turn are backed up by the original out and err PrintStream's. You would use System.setErr() and System.setOut() very early (static initializer block) in the startup of your class. The problem is that you are still at the mercy of code that may call flush() on these streams. I suppose you could implement your own FilterOutputStream to eat any flush requests...
    Another solution if you just don't care about the output is to replace System.out and System.err with PrintStreams that write to /dev/nul. This is really easy and efficient.
    The other tried and true approach is to start two threads in the main process each time you start a process. These will simply consume anything that is emitted through the stdout and stderr pipes. These would die when the streams close (i.e. when the process exits). Not pretty, but it works. I'd be worried about the overhead of two additional threads per external process except that processes have such huge overhead (considering you are starting a JVM) that it just won't matter. And it's not like the CPU is going to get hit much.
    If you do this frequently in your program you might consider using a worker thread pool (see Doug Lea's Executor class) to avoid creating a lot of fairly short-lived threads. But this is probably over-optimizing.
    Chuck

  • Supressing windows spawned from Runtime.exec()

    Hi,
    I was wondering if anyone had any suggestions on how to suppress windows spawned from using Runtime.exec(program). I've had a good look at the Process object returned from this and cant find a way to do it. I'd like to keep the process being run completely invisible from the user but i'm getting a blank window appear - spawned from the app being run.
    Any ideas?
    TIA,
    Danny

    The exec is called k.exe - its a programming language. I'm writing an interface for a database system called KDB which is implemented in K. (called using 'k db args...').
    Have a look at www.kudib.com if you want to see a bit more about my project or www.kx.com to learn more about K and KDB.
    Danny

  • How to assign to String[] from StringBuffer in a loop?

    Hi all,
    public class Test {
    public String[] getSJ() 
            String[]    jg;
            String[]    jig;
            String[]    tg;
            String[]    result;
            Date startTime;
            StringBuffer buf = new StringBuffer();
            int i;
            int j;
            int k = -1;
    jg = {"g1", "g2"};
    for( i=0; i < jg.length; i++ )
             jig = {"1", "2", "3"};
             for( j=0; i < jig.length; j++, k++ )
                   buf.append( jg[i] ).append( ":" );                                      
                   buf.append( jig[j] ).append( ":" );   
                   buf.append( Date() );    
                   result[k] = buf.toString();
                   buf = null;
    }I want to add to result string array by assigning from buf which is StringBuffer in a loop. But what happens after buf = null??
    Will the added String be gone?
    Or should I just do:
    buf = "";
    and continue with the loop and the string objects will be preserved? But isn't result just an array of references?
    Many thanks,

    I am not sure I understand correctly. Here is a test program (in real program I call APIs from a library which returns String[] for jg and for jig, i.e they are changing in the loop in runtime.
    I tried to put together test program:
    import java.util.*;
    public class Test {
         public void Test() {
    public String[] getSJ()
            String[] jg = {"g1", "g2"};
            String[] jig = {"1", "2", "3"};
            String[]    result = new String[50];
            StringBuffer buf = new StringBuffer();
            int i;
            int j;
            int k = 0;
    for( i=0; i < jg.length; i++ )
             for( j=0; i < jig.length; j++, k++ )
                   buf.append( jg[i] )
                      .append( ":" )
                      .append( jig[j] )
                      .append( ":" )
                      .append( new Date() );
                   result[k] = buf.toString();
                   buf = null;
       return result;
    public static void main( String[] args ) {
        Test   t = new Test();
        String[] res = t.getSJ();
        for( int i=0; i<res.length; i++ ) {
         System.out.println( res[i] );
    }but when I run it fails in this statement:
    buf.append( jg[i] )
                      .append( ":" )
                      .append( jig[j] )
                      .append( ":" )
                      .append( new Date() );Exception in thread main
    java.lang.NullPointerException
    java.lang.String[] Test.getSJ()
    Test.java:24
    void Test.main(java.lang.String[])
    Test.java:38
    Wierd!?
    And if I change to:
    buf.setLength(0);
    then it fails with this error:
    Exception in thread main
    java.lang.ArrayIndexOutOfBoundsException: 3
            java.lang.String[] Test.getSJ()
                    Test.java:24
            void Test.main(java.lang.String[])
                    Test.java:38Also, I would like not to have to allocate like in:
    String[] result = new String[50];
    because I do not know how many different Strings in array will be returned by API. Is it possible to dynamically adjust
    String[] result
    somehow?
    Many thanks,

  • Runtime.getRuntime().exec() and Garbage Collection

    I am programming a piece of software in both Java and C that has some strict real time requirements. Garbage collection, which pauses all threads in Java, sometimes causes loss of incoming data. In order to get around this, I am thinking to start another process using Runtime.getRuntime().exec("c_program") and using interprocess controls (in a UNIX environment) to retrieve data from the new process.
    My only worry is that the Process created by the above call would be a child process of whatever JVM thread created it, (as far as I understand, the JVM implementation in Unix uses multiple processes) and would also be paused when garbage collection occurs. Does anyone know the implementation of the exec functionality and the JVM well enough to say that this will or will not happen?
    Thanks in advance,
    Benjamin

    You're going to create a whole new process? I don't
    know what a "child process" means, but Runtime.exec()
    gets the operating system to produce an entirely new
    process, outside the JVM. However if it produces
    output on stdout or stderr, you're going to have
    threads in your JVM that read that output, otherwise
    that process will hang.
    Why is your idea better than just calling the C
    program via JNI?Thank you both for your replies. My plan was to create a whole new process, yes. In UNIX, a process C is created by another process P using fork() or the exec() family. Process P is then the parent of process C, and process C is the child of Process P. P has an amount of control over C since it can send various signals to pause, kill, etc to C.
    My concern was that the JVM implementation would use these signals to implement the pause of all threads before garbage collecting. If it did, it may also pause the Process that it spawned from the Runtime.exec() call. Pausing my C program in this manner would cause the loss of data I was trying to avoid in the first place.
    My plan for the new process was not to produce anything on stdout or stderr, but to pass data back to the JVM using ipc (interprocess communication) resources of UNIX. I would have to use the JNI to access these resources.
    The whole reason for wanting to do this is to avoid the pause during garbage collection that all Java Threads experience. If I were just to call the C program through the JNI with a normal Java Thread as I think you were suggesting, this Java Thread would still be paused during garbage collection.
    To the second reply about RTSJ, I had heard about this but couldn't find info about it! Thanks for the link. I'm checking it out at the moment. The java runtime must be considerably different for the specifications I see that they guarantee.
    Again, thanks for the replies,
    Benjamin

  • Performance Example

    Last week, there was a question posted to the forum asking about how to retrieve multiple records from an internal table without using a loop…endloop construct. I posted an answer showing how it could be done using a binary search followed by indexed reads on the table. I wrote a small program which illustrates this point. I’ve posted the code below, but in a nutshell, what it does is select a number of FI document headers and line items from BKPF and BSEG. The select statement from BSEG is very inefficient. I did it that way for a reason, so please don’t give me any grief over it. It then reads all records from both tables using a nested loop. Finally it reads all records from both tables using the method I proposed. It keeps track of the number of records and time taken for each operation.
        I ran the program twice in our QA environment – once selecting a small amount of data and again selecting a moderate amount. The outputs are:
    First run -
    Time for unindexed select: 00:08:31  
        Number of BKPF entries:      1,892
        Number of BSEG entries:      5,777
    Time for nested loop: 00:00:05       
        Number of BKPF reads:      1,892 
        Number of BSEG reads:      5,777 
    Time for indexed loop: 00:00:00      
        Number of BKPF reads:      1,892 
        Number of BSEG reads:      5,777 
    Second run –
    Time for unindexed select: 00:17:31  
        Number of BKPF entries:     24,148
        Number of BSEG entries:     84,358
    Time for nested loop: 00:23:44       
        Number of BKPF reads:     24,148 
        Number of BSEG reads:     84,358 
    Time for indexed loop: 00:00:00      
        Number of BKPF reads:     24,148 
        Number of BSEG reads:     84,358 
        So what can we conclude? In the first case, a gain in time of five seconds is not much, but in a dialogue program, it might be worthwhile. But in the second case the other method gains over twenty minutes. This would allow a program that has to run in the background to run in the foreground. The most striking thing to me though, is the fact that the nested loop takes substantially longer than an extremely inefficient select statement.
        The select screen for the program is quite standard. The amount of data returned is determined by whatever the user enters and the programmer really has no control over it. So I’m suggesting that if you can’t guarantee that the amount of data is small, then you really ought to use the indexed read method.
        Also note that the first select statement returns 5,777 rows from BSEG and takes 08:31 to run and the second one returns 84,358 rows and takes 17:31. The second one retrieves almost 15 times as much data but takes only about twice as long to execute. The two runs of the program were on separate evenings when there shouldn’t be any load, so buffering and workload shouldn’t be issues.
        So, my final conclusion is: when tuning a program that you know will return a small amount of data, tune the select statement and don’t worry too much about loops; however, if the program may return a large amount of data, avoid nested loops.
    Code follows:
    REPORT ztest.
    TABLES: bkpf, bseg.
    SELECT-OPTIONS: s_bukrs FOR bseg-bukrs MEMORY ID buk OBLIGATORY,
                    s_gjahr FOR bseg-gjahr MEMORY ID gjr OBLIGATORY,
                    s_lifnr FOR bseg-lifnr MEMORY ID lif OBLIGATORY.
    DATA: BEGIN OF bkpf_int OCCURS 0.
            INCLUDE STRUCTURE bkpf.
    DATA: END   OF bkpf_int.
    DATA: BEGIN OF bseg_int OCCURS 0.
            INCLUDE STRUCTURE bseg.
    DATA: END   OF bseg_int.
    DATA: start_time   LIKE sy-uzeit,
          end_time     LIKE sy-uzeit,
          difference   LIKE sy-uzeit,
          bkpf_entries LIKE sy-tabix,
          bseg_entries LIKE sy-tabix,
          bkpf_reads   LIKE sy-tabix,
          bseg_reads   LIKE sy-tabix.
    START-OF-SELECTION.
      PERFORM unindexed_select.
      PERFORM nested_loop.
      PERFORM indexed_loop.
    *&      Form  unindexed_select
    FORM unindexed_select.
      GET TIME FIELD start_time.
      SELECT * FROM bseg INTO TABLE bseg_int
        WHERE  bukrs IN s_bukrs
        AND    gjahr IN s_gjahr
        AND    lifnr IN s_lifnr.
      SELECT * FROM bkpf INTO TABLE bkpf_int
        FOR ALL ENTRIES IN bseg_int
        WHERE bukrs = bseg_int-bukrs
        AND   belnr = bseg_int-belnr
        AND   gjahr = bseg_int-gjahr
        AND   bstat = space.
      CLEAR   bseg_int.
      REFRESH bseg_int.
      SELECT * FROM bseg INTO TABLE bseg_int
        FOR ALL ENTRIES IN bkpf_int
        WHERE bukrs = bkpf_int-bukrs
        AND   belnr = bkpf_int-belnr
        AND   gjahr = bkpf_int-gjahr.
      GET TIME FIELD end_time.
      difference = end_time - start_time.
      DESCRIBE TABLE bkpf_int LINES bkpf_entries.
      DESCRIBE TABLE bseg_int LINES bseg_entries.
      WRITE: /001 'Time for unindexed select:', difference,
             /005 'Number of BKPF entries:', bkpf_entries,
             /005 'Number of BSEG entries:', bseg_entries.
    ENDFORM.                    " unindexed_select
    *&      Form  nested_loop
    FORM nested_loop.
      GET TIME FIELD start_time.
      LOOP AT bkpf_int.
        bkpf_reads = bkpf_reads + 1.
        LOOP AT bseg_int WHERE
          bukrs = bkpf_int-bukrs AND
          belnr = bkpf_int-belnr AND
          gjahr = bkpf_int-gjahr.
          bseg_reads = bseg_reads + 1.
        ENDLOOP.
      ENDLOOP.
      GET TIME FIELD end_time.
      difference = end_time - start_time.
      WRITE: /001 'Time for nested loop:', difference,
             /005 'Number of BKPF reads:', bkpf_reads,
             /005 'Number of BSEG reads:', bseg_reads.
    ENDFORM.                    " nested_loop
    *&      Form  indexed_loop
    *       text
    FORM indexed_loop.
      DATA: bkpf_index LIKE sy-tabix,
            bseg_index LIKE sy-tabix.
      CLEAR: bkpf_reads,
             bseg_reads.
      GET TIME FIELD start_time.
      SORT: bkpf_int BY bukrs belnr gjahr,
            bseg_int BY bukrs belnr gjahr.
      LOOP AT bkpf_int.
        READ TABLE bseg_int WITH KEY
          bukrs = bkpf_int-bukrs
          belnr = bkpf_int-belnr
          gjahr = bkpf_int-gjahr
          BINARY SEARCH.
        bkpf_reads = bkpf_reads + 1.
        bseg_index = sy-tabix.
        WHILE sy-subrc = 0.
          bseg_index = bseg_index + 1.
          bseg_reads = bseg_reads + 1.
          READ TABLE bseg_int INDEX bseg_index.
          IF bseg_int-bukrs <> bkpf_int-bukrs OR
             bseg_int-belnr <> bkpf_int-belnr OR
             bseg_int-gjahr <> bkpf_int-gjahr.
            sy-subrc = 99.
          ELSE.
          ENDIF.
        ENDWHILE.
      ENDLOOP.
      GET TIME FIELD end_time.
      difference = end_time - start_time.
      WRITE: /001 'Time for indexed loop:', difference,
             /005 'Number of BKPF reads:', bkpf_reads,
             /005 'Number of BSEG reads:', bseg_reads.
    ENDFORM.                    " indexed_loop

    Hi, something in additional.
    Can anyone explain why the two ways has a so definitely difference in performance, in the ABAP runtime analyze view.
    In my opinion, maybe binary read is a short quick action in the memory. On the opposite side, when do nested loop, the runtime will need many swap memory action as it need to keep the status info of external loop, that will cost a lost in performance.
    That's the supposition of mine. Really hope anyone can explain the reason under the phenomena.
    thanks

  • Performance of queries against large AD CS databases - how to optimize?

    I am asking experts with experience with AD CS databases with 100.000s or millions of certificate to confirm or correct my "theories".
    I am aware of these two articles that state performance is not an issue for millions of certificates:
    Windows CA Performance Numbers and
    Evaluating CA Capacity, Performance, and Scalability
    However, here performance is mainly evaluated in terms of database size and request / certificate throughput. I am more interested in the performance of queries as I have seen that it might take minutes to build up views for databases with 100.000s of certificates
    - no matter if you use certutil -view, certsrv.msc, or access to CCertview.
    Could this just be due to an "unfortunate" combination of non-indexed fields? Any advice on which queries to avoid?
    Or is the solution just as simple as to throw more memory or CPU or both at the problem?
    In case it hinges on an unfortunate choice fields and you absolutely have to do this query my guess is that you have to use a custom policy(*) module (FIM or third-party) to dump certificates to a SQL database and do your queries there.
    Am I right or did I miss something? Any input is highly appreciated!
    Elke
    PS / edit: That should have been 'Exit module' - I don't know why I wrote Policy Module. Thanks for Vadims for pointing it out.

    > I meant 'exit module'
    exit module is correct one. However, it is notified by a CA only when new request is issued/processed. This means that you can use Exit Module to copy certificate information to SQL only for new requests, for existing requests you are still sticking
    with a database dump.
    > but I should probably check how I dealt with the row handles
    I don't know how COM handle are working in VBS, but in PowerShell (and other CLR languages) COM handle may not be handled properly by a garbage collector, therefore, when COM object is not necessary, you should set reference count to zero. In CLR it is made
    by calling Marshal.ReleaseComObject method. This will mark COM object as safe for garbage collector. For example, the typical row/column iterator scheme is:
    $Row = $ICertView.OpenView()
    # do row iteration
    while ($Row.Next() -ne -1) {
    # acquire IEnumCERTVIEWCOLUMN COM object
    $Column = $Row.EnumCertViewColumn()
    # do column iteration for the current row
    while ($Column.Next() -ne -1) {
    # collect column information and other stuff
    # do other stuff if necessary
    # release IEnumCERTVIEWCOLUMN object. This is the last line in the while/do loop.
    [Runtime.InteropServices.Marshall]::ReleaseComObject($Column)
    # release IEnumCERTVIEWROW COM object as well
    [Runtime.InteropServices.Marshall]::ReleaseComObject($Row)
    My weblog: en-us.sysadmins.lv
    PowerShell PKI Module: pspki.codeplex.com
    PowerShell Cmdlet Help Editor pscmdlethelpeditor.codeplex.com
    Check out new: SSL Certificate Verifier
    Check out new:
    PowerShell FCIV tool.

  • Checking the performance of Pl/SQL Procedure

    I have a PL/SQL procedure of 10,000 lines, & I dont have any Tool of performance checking only thing I have is SQL Client & database how whould I check the performance of the procedure

    Why do you want to check the performance? Have you indentified a specific problem?
    It is not easy to to "simply check the performance" of code. Let's say it has an elapsed execution time of 90 seconds. What does that tell you? Fast? Slow? Average? What does 90 seconds tell you about the resource utilisation? Nothing much - are resources being red lined for those 90 seconds or not?
    So unless there is a specific performance problem that has been diagnosed, e.g. the process uses too much PGA memory, you cannot really identify a performance problem.
    What you can do is use DBMS_PROFILE (Oracle supplied PL/SQL package) to profile the execution time of the code. This will tell you which pieces of the code are slower than others. This allows you to focus on area where possible optimisation can reduce overall execution time - or it could be that these areas are already optimised.
    What you can miss with this approach is a small loop that takes a few seconds to execute - less than 1% of the total elapsed execution time. But this loop can be very wrong and should have taken a few millisecs to do. A month later running against big production data volumes, this loop's runtime changes into minutes and over 50% of the overall execution time of the process.
    You may look at the FOR CURSOR FETCH loop and see that it has been optimised. Great, so you move on to look at the next piece of code. Only, there are other loop constructs that can be exponentially faster than this loop - like a bulk processing loop instead.
    You may look at a SQL that seems slow, but after investigation it seems to be optimal. And it could well be. But performance can be increased by 80% by not touching the SQL and instead changing the table's structure from a normal heap table to a ranged partitioned table.
    The bottom line is that there are no magic wands and crystal balls that can be used to check performance and tell you that "abc" is wrong. Tools can tell you what is slow, what is resource expensive - but it cannot tell you whether the code does what it is suppose to do in the best and most effective way. Only a programmer can. Which means that things like code reviews, design walk-thru's and so on, are critical pieces to ensure that the code is performant and can scale.

  • When user 50-55 logs onto Win2k 9iAS it breaks - is this bad configuration?

    Hi, one of our guys did a loadtest on our windows 2000 9iAS 9.0.2.0.0 installations, and for some unknown reason they break down on around 50-55 users.
    It reports that the runtime process cannot be contacted (probably because the server won't start one?).
    Later tests have shown that all he needs to do to make it break is log on with the 50 users, i.e. it is not load that breaks the machine (4 GB RAM, 2x1400 MHz Xeon or 4 GB RAM, 1x2.8GHz Xeon, it doesn't matter). Load is negligible and there's plenty of CPU and RAM left on the system, whether you measure it with the performance monitor or just ye olde task manager.
    We're thinking "simple configuration problem" because it breaks so consistently around 50-55 users and all they've done is spawn one forms runtime process down on the 9iAS. Would anyone here know what may have hit us?
    Regards,
    Jesper Vad Kristensen
    Aarhus, Denmark

    Hi Chetan,
    I get an error stating that the runtime process cannot be contacted - I don't have the complete text in English as it insists on showing Danish error messages. But you can check these two gifs (they come in that sequence):
    http://tux.nerdheaven.dk/~jevk/err1.gif
    http://tux.nerdheaven.dk/~jevk/err2.gif
    Where do I find "init.ora" settings? Is it a file or ...?
    Regards,
    Jesper Vad Kristensen

  • Scrollbar with AS3 generated content

    Hi all,
    I want to use the built in Scrollbar component to scroll within a movie clip or sprite whose content is generated by a for loop within my code. I can't seem to get it working when I set the scrollbar at authortime to target the movieclip into which i place the for loop at runtime.
    Thanks!
    Justin

    The scroll page is what I call it. So, the "scroller" contains four layers:
    This is the script in the scroller:
    onClipEvent (load) {
    var active = 0;
    var mh = _parent.Mask._height-5;
    var maxmove = mh-this._height;
    var amount = 0;
    var fc = 0;
    if (maxmove>-6) {
    _parent.Scroll_Buttons._x = 1000;
    onClipEvent (enterFrame) {
    if (fc<80) {
    this._y = Math.round((this._y-(this._y-_parent.Mover._y)*0.15));
    fc++;
    if (active == 1) {
    fc = 0;
    if (_parent.Mover._y>maxmove) {
    _parent.Mover._y -= 10;
    if (active == 2) {
    fc = 0;
    if (_parent.Mover._y<0) {
    _parent.Mover._y += 10;
    The Layers in the scroller:
    • Mover: Nothing special.
    • Mask: The mask is the layer that's shows how much of the scroll page to be shown; like x:800 and y:800.
    • Page: The page is where all the objects are lined up like a long page, but still it's the mask that show's how much of this page to be shown.
    • Scroll buttons (Two separate buttons: one up and one down. The behavior of the buttons when pressed is just a simple motion tween.
    Here's the code in the DOWN button:
    on (rollOver) {
    gotoAndStop("Over");
    on (rollOut) {
    gotoAndStop("Out");
    on (press) {
    gotoAndPlay("Hit");
    _parent._parent.Scrolling_Page.active = 2;
    on (release, releaseOutside) {
    gotoAndPlay("Up");
    _parent._parent.Scrolling_Page.active = 0;

  • Spawn a java process using runtime.exec() method

    Hi,
    This is my first post in this forum. I have a small problem. I am trying to spawn a java process using Runtime.getRuntime().exec() method in Solaris. However, there is no result in this check the follwoing program.
    /* Program Starts here */
    import java.io.*;
    public class Test {
    public static void main(String args[]) {
    String cmd[] = {"java", "-version"};
    Runtime runtime = Runtime.getRuntime();
    try{
    Process proc = runtime.exec(cmd);
    }catch(Exception ioException){
    ioException.printStackTrace();
    /* Program ends here */
    There is neither any exception nor any result.
    The result I am expecting is it should print the following:
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    Please help me out in this regard
    Thanks in advance
    Chotu.

    Yes your right. It is proc.getInputStream() or proc.getErrorStream(). That is what I get for trying to use my memory instead of looking it up. Though hopefully the OP would have seen the return type of the other methods and figured it out.

  • JVM spawning mysterious child process of itself using Runtime.exec()

    Hello, I'm not sure if this is how this is supposed to work but I have a java application that monitors legacy c programs and after a period of time (its intermittent), I'll see a duplicate jvm process running the same classpath, classname as a child of the java application monitor. This behaviour can be reproduced with the following simple class running on either solaris 9 or 10 using 1.6.0_03-b05:
    public class Monitor {
    Process procss;
    public Monitor() {
    try {
    Runtime runtime = Runtime.getRuntime();
    for (int i = 0; i < 10000; i++) {
    System.out.println("execing command ls -l.");
    procss = runtime.exec("ls -l");
    procss.waitFor();
    catch (Exception e) {
    e.printStackTrace();
    public static void main(String[] args) {
    new Monitor();
    Using java -classpath ./ Monitor to run it. While this is running, at intermittent times doing a ps -ef you will see a duplicate jvm running whose parent process is the one that was started on the command line. Ie:
    UID PID PPID etc
    user 17434 10706 .... java -classpath ./ Monitor (the one I put running)
    user 27771 17434 .....java -classpath ./ Monitor (intermittently started)
    in another window I'll run the following shell script that will output the processes when a duplicate java process gets started as they don't seem to run very long (on my production system they will occasionally get hung up until I manually kill them):
    #!/usr/bin/ksh
    while ((1 == 1))
    do
    ps -ef | grep "Monitor" | grep -v grep > /tmp/test.out
    VAL=`cat /tmp/test.out | wc -l`
    if (($VAL != 1))
    then
    echo "Duplicate java process started"
    cat /tmp/test.out
    fi
    done
    It takes roughly 30 seconds before I start to see duplicate jvms starting to run. The concern is that is the new jvm instance running the Monitor class? Eventually on my production system the real application will have a child or 2 linger indefinetly, and threads will be deadlocked. Once I kill these child java processes, everything is back to normal. This doesn't seem to occur with the above java class but will show the duplicate child jvm's start to run after a bit.

    This is true for Solaris and Linux. Sun's implementation does a fork. A lot of people who have very large memory java applications wish there was a way to create a process from Java that doesn't involve copying the parent process. As far as I know your stuck.
    A workaround: Use jms, rmi, sockets, or files to communicate with a low memory footprint java application whose sole purpose is to spawn child processes.

  • Process core dumps when spawned by Runtime.exec()

    I am using a Runtime.exec() command to spawn a local executable process on HP-UX. The local process (C++ executable) starts and is functional, though at a certain point during operation, the process creates a segmentation fault and core dumps. If the same process is spawned manully from a shell, this does not occur.
    The process cores at the same point every time (a call to free+ in the system libC library). I have duplicated as much of my shell environment in the Runtime.exec() call as possible. Also, this issue does not occur on AIX or Linux (ports of my code to those platforms).
    What is the fundimental difference between spawning a process from a shell V.S. the JVM spawning the process that could cause this difference in behavior?
    java version "1.4.2.07"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2.07-050121-15:53)
    Java HotSpot(TM) Server VM (build 1.4.2 1.4.2.07-050121-17:30-PA_RISC2.0 PA2.0 (aCC_AP), mixed mode)

    We are currently having the same problem, it is killing us.
    We have upgraded to jdk 1.6u16 and still have the problem.
    We think it is related to sparc platform we had been running for some time with same code on X86 server
    Our solaris release is: Solaris 10 11/06 s10s_u3wos_10 SPARC
    We can't get a reproducible small test case. It is getting us most often when the JVM running our
    appserver uses the Runtime.getRuntime().exec(cmd);
    We are jumping through hoops looking for workaround. We are trying to write a command server that can
    have the command sent through a socket and have all the ouput sent back over the same socket.
    That way the app server JVM is not the one doing the fork and exec.

  • Addchild in loop, how to recover X and Y of a specific spawned mc

    Hi everyone,
    I'm currently trying to program a little tile based game and i have a problem :
    I use a double array for placing tiles, with ~240 addchild, when i click on one tile i want the program to save the position of this tile
    So this is the concerned part of the code :
    function boucleCell3(mapcalque3): void {
           var compteur = 0
           for (var i: int = 0; i < mapHeight; i++) {
                for (var j: int = 0; j < mapWidth; j++) {
                     var cell: MovieClip = new calque3();
                     cell.gotoAndStop(mapcalque3[i][j] + 1);
                     if (i % 2 == 1) {
                          cell.x = tileSide * j - tileSide / 2 - 60;
                          cell.y = (tileSide / 4) * i - 50;
                   else {
                          cell.x = tileSide * j - 60;
                          cell.y = (tileSide / 4) * i - 50;
                 //cell.name = compteur;
                cell.addEventListener(MouseEvent.CLICK, savePos);
                //trace(name)
                addChild(cell);
                //compteur +=1
                //trace(compteur)
      function savePos(e: MouseEvent): void {
      posXsouris.text= String(cell.x);
      posYsouris.text= String(cell.y);
    At first i wanted to simply name every child by "case" + String(compteur), but i realise i can't because trace(name) only return "root1".
    Then i tried to use mouse position like this : " If 40<mouse.x<120 and 30<mouse.y<60 but there is 240 tile so i don't really know. (and if the game isn't in fullscreen, everything is fked)
    In fact i wanted to have a name for every tile so i can use the tile position like this "spawnCharacter.position = tile54.position" (i don't think .position exist, so it will be spawnCharacter.x = tile54.x ....)
    Thanks for reading and even more if you have an idea or a part of solution.

    Yeap
    But there is still something i don't understand in AS3, you arlready tried to explain me but it's still weird
    why the code doesn't wait for execute ?
    Why a code like this doesn't work :
    var result: int = 0
    fonction simpleFonction(){
    random calcul / for/if/else
    result = 7
    simpleFonction()
    trace(result)
    And we have result = 0
    I have the same problem with my code so i tried a new code and to use a while but it seem to be an infinite loop and adobe flash pro crash
    var compteur = 0
      function onLoaded3(e: Event): void {
           var maptext: String = e.target.data;
           mapcalque3 = maptext.split("\r\n");
           for (var u: int = 0; u < mapcalque3.lenght; u++) {
                mapcalque3[u] = mapcalque3[u].split(" ");
           for (var i: int = 0; i < mapHeight; i++) {
                for (var j: int = 0; j < mapWidth; j++) {
                var cell: MovieClip = new calque3();
                cell.gotoAndStop(mapcalque3[i][j] + 1);
                if (i % 2 == 1) {
                     cell.x = tileSide * j - tileSide / 2 - 60;
                     cell.y = (tileSide / 4) * i - 50;
                } else {
                cell.x = tileSide * j - 60;
                cell.y = (tileSide / 4) * i - 50;
                cell.name = "case" + String(compteur);
                trace(cell.name);
                addChild(cell);
                listeCase[compteur] = this.getChildByName(cell.name)
                compteur += 1
                trace(compteur);
    while (compteur =! 0) { // compteur = 0 here
      mapLoader3.load(new URLRequest("mapcalque3.txt"));
    // compteur = 239 here so the loop should be finished not infinite
    trace(7+7)

  • Runtime Engine installer spawns from unrelated software

    Hello all,
    When I run a completely unrelated app (Quickbooks timer, in case you're wondering), Windows Installer launches and attempts to install LabVIEW 7.1 runtime engine. Has anyone else encountered this, and why would it occur? Is there an easy solution besides installing the runtime engine?
    Thanks

    Hello CT_JIM,
    We are probably seeing this behavior because your application (Quickbooks Timer) is querying Windows to confirm that all MSI installers are installed properly. In this case some part of the LabVIEW RTE must not have been installed completely and Windows is trying to correct it.
    This can typically be resolved by reinstalling or repairing the RTE to fix the install.
    Please let me know if you have any questions.
    Regards,
    Matt F
    LabVIEW Run-time Engine Version 7.1 for Windows 2000/NT/XP
    Keep up to date on the latest PXI news at twitter.com/pxi

Maybe you are looking for

  • Recovery failed during homognuos System copy maxdb 7.7 red hat 5.4 ECC 6.0

    Hi all,          *Actully i have one Development Server with ECC 6.0.. + maxdb 7.7 database    OS  Red Hat 5.4. Please help us to what username and password we can give....i am from oracle backgroud so i am a newbie in maxdb. Source System ECC 6.0 OS

  • How do I add remove Multiple rows in a table

    Guys, Can somebody tell me How do I add and remove <u><b>Multiple</b></u> rows between two tables. <u>Also, I want the row or rows to disappear from the source table as soon as it is moved or added to the second table and appear again once its been r

  • Movie download failed

    I was downloading 2 movies for rental on itunes to my imac.  My internet connection was lost.  My credit card was charged, but now my movies are nowhere to be found.  I went to the Store and checked for available downloads and it stated that all purc

  • Not Gettng Web dynpro abap application creation menu in SE80

    Hi all, I m new in WDA.I wanted to create one web dynpro application in abap with se80. however, in se80 i m not getting any option to create the application . IF i go to other objects in the main menu ie. (prgrams-->other objects) from se80 , i get

  • Finder dosn't sort by time correctly

    I decided after a long time to upgrade to mavericks from snow leopard. Apart from some issues it works pretty well. However one issue is really annoying. When I choose to sort by "date" it only groups the files in "today" "yestarday" and so on. Finde