Problem from Difference betw Thread and Process.

Hi,
my app create new Process and execute subtask. So, Main Process wait for the sub process to finish. Like follow.
Process child= Runtime.getRuntime().exec(cmds);//run java ClassName cmdArrays..
try {
child.waitFor();
} catch (InterruptedException e) {
//when error ocurrs it return error message
return "Running Process error :\n "+
e.getMessage();
In this case if sub process run swing application, parent process seem to freeze.
It will wait forever.
I try to create new Thread to create new Process. But, the problem is child process is created by parent process. But, Parent is Thread not process.
So, waitFor still make parent process freeze. Is this right?
How can I solve this problem?

waitFor() becasue I need input/errorStream You do not need to call waitFor() first in order to get the input/error streams of the child process!
                        Runtime         rt=Runtime.getRuntime();
                        Process         proc=rt.exec(command);
                        InputStream is=proc.getInputStream();
                        LineNumberReader lnr=new LineNumberReader(new InputStreamReader (is));
                        sRet=lnr.readLine();
                        String line;
                        while((line=lnr.readLine()) != null) {
                                if (DEBUG1) System.out.println(line);
                                InputStream is2=proc.getErrorStream();
                                LineNumberReader lnr2=new LineNumberReader(new InputStreamReader (is2));
                                while((line=lnr2.readLine()) != null) {
                                        System.err.println(line);
                        iRet=proc.waitFor();

Similar Messages

  • Difference between Thread and Process

    Hi!
    I was googling about this subject, and I found this old thread on google: http://forum.java.sun.com/thread.jspa?threadID=580508&messageID=2939031
    My specific doubt is: can one thread inside in a process affect other thread inside in other process?
    But, actually, the terms thread and process are not clear for me yet. I don't know what is the exact difference yet.

    > If I start a JVM, and Microsoft Word, and a web
    browser, that's three processes. A process is an
    OS-level construct.
    Threads refer to concurrent execution paths withina
    given process. Just like multiple processes canrun
    in parallel within the OS, so can multiple threads
    run in parallel within a process.
    That's exactly what I understood. So, I suppose that
    a thread in a process cannot affect other thread in
    other process, can it?Not at the Java language level.
    I mean, the wait( ), notify(
    ), etc, methods do not make sense if you consider
    threads of different process, right?Right. Those are just methods that you call on objects. The same rules apply to them as to other methods. Now, with RMI, it might be possible to call wait(), etc. on a remote object. I've never use RMI, but I don't think that actually works. If it does, I expect it would be in an RMI tutorial.
    Indeed, very confusing. They could facilitate,
    defining a clear distinction between thread and
    process.Well, there is a distinction in their "interface," if you will. It's just that their implementations can overlap.
    Kind of like how a List and a Set are different, but you could implement a Set by composing it with a List.

  • Difference between Overheads and Process Costs

    Hi Experts,
    May somebody clarify the difference between Overheads and Process Costs in PS application. This problem puzzled me for a long period. Thanks in advance!

    Hi Allen
    Please go through this link
    http://help.sap.com/saphelp_pserv464/helpdata/EN/e9/3cb2a4b05411d29f5e080009b0db33/frameset.htm
    I hope it will be very useful to you in understanding.
    Regards,

  • I changed the mac´s disk and now sometimes a rainbow circle appears from time to time and processing stops, what is happening? OS 10.6 mac pro

    I changed the mac´s disk and now sometimes a rainbow circle appears from time to time and processing stops, what is happening???   it is a MAC Pro 8GB RAM Snow leopard 10.6.8

    http://www.thexlab.com/faqs/sbbod.html

  • Differences between MIC and Process control

    Hi
    Could someone please let me know what are the major differences between MIC and process control 2.5.
    I have heard that Process control 2.0 is not being used now.
    So could you please let me know what the differences for MIC and Process control 2.5.
    Regards
    Sandhya

    Hi Sandhya,
    the major differences are:
    - automated controls (SAP and non-SAP systems)
    - UI interface based on NetWeaver Business Client (NWBC)
    - flexibility on scheduling assessments and tests based on control attributes
    - configurable reports and extraction to either .pdf or .xls
    - possibility to se configure workflow to send reminders and escalations
    - integration with Access Control 5.3, RAR component
    - concept of service providers allowing controls to be referenced between different organizations (former MIC orgunit)
    - assessments based on surveys (questions to be answered)
    - effectiveness tests based on test plan (both tests and steps)
    Regards
    Andre Yuji

  • What are the practical differences betweens infopackages and process chains

    Hi,
    what are the practical differences betweens infopackages and process chains.
    Thanks,
    cheta.

    Hello BW,
    Hope the following links will give u a clear idea about process chains
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/sap-teched-03/using%20process%20chains%20in%20sap%20business%20information%20warehouse
    Business Intelligence Old Forum (Read Only Archive)
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    /people/siegfried.szameitat/blog/2006/02/26/restarting-processchains
    regards,
    Muralidhar Prasad.C

  • Difference bet Thread and Runnable Inteface

    what is the main difference bet Thread and Runnable interface. Where it is used Thread and Where it is used Runnable interface

    http://www.javaworld.com/javaworld/jw-04-1996/jw-04-threads.htmlThere are a lot of differences, see the article above for details.
    Generally, I would only extend Thread if I want to enhance/extend the functionality of how Threads work (like providing a Timer or a Clock, or something). If all I am doing is providing some work to be done in a separate thread, then I will create a class that implements Runnable and run it using new Thread(myRunnable).start(). Most of the time, I use Runnable, since rarely would I need to change how threads act.

  • Problem in mapping GP parameters and process completion

    Hi,
    I have a block which is sequential and it contains:
    1. action ( the first screen of the process)
    2. an alternative block ( 4 actions)
    3. when i run the process, following happen:
        a. the first screen opens up with proper details
        b. on click of button, second screen as well opens up. But the data that gets passed is only the gp single attributes. Any tabular structure data doesnt get passed.
        c. on second screen, if i click reject, it displays the last screen as per the result state set, but again no data gets passed ( in this not even the single attributes)
        d. on second screen, if i click accept, it goest to the third screen as per the result state set, but no structure data gets passed. Only single attributes are displayed.
        e. on the second screen, when i click next button, it doesnt display the thrid screen, just a message that action is completed. Whereas, ideally it should take the user to the fourth screen.
    4. i have mapped all the attributes in the alternative block.
    5. when i created sequential block, in that as well, all the attributes of first action and alternative block were grouped. ( whats the difference between group and propose consolidation functionality)
    6. i have set the targets in the result states of second and third screens.
    Second screen has 2 conditions: if approved, goes to third screen, and if rejected, it goes to the last summary screen.( both happening, but data not getting passed)
    Third screen has only one result state - success. for this also , i have set the target as fourth screen, but it doesnt appear.( not happening)
    Can anyone please help in this regard.
    Thanks  & regards,
    Anupreet

    Hi,
        I think your process flow is like that
          Process
             Sequential block
                   Action
                   Alternative block
                        Action 1
                        Action 2
                        Action 3
                        Action 3
       The Hierachy of Action in Sequential block and Action in Alternative block is different.
    use the process flow like this
            Process
               Sequential block
                    Action
               Alternative block
                    Action 1
                    Action 2
                    Action 3
                    Action 4
      create the Sequential block and Alternative block in the process level and u map the Attributes in the process level.The Attributes will be mapped in the Process Level.The Attributes will be mapped both in Process level and in Block level if it is in same Hierachy level.
    Regards,
    Satheshkumar.R

  • Without NI DAQ device- how to get data from MSP into labVIEW and process it

    Hi,
    I do not have an NI DAQ device. I have an MSP430 and my sensor is an ADXL335 Accelerometer. How do I get data from my MSP into labVIEW and process it?
    Just looking for a nudge in the right direction. I'm having a hard time finding resources on labVIEW that don't involve NI specific DAQs. 
    Thanks in advance,
    Aziz

    There are many ways to get data into LabVIEW that do not involve NI-DAQ devices.
    I think your easiest option would be to stream it via serial port if the data rate isn't too fast.
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle

  • File Upload Problem from Linux to Windows and Windows to Linux

    Hi,
    I am a newbie in the flex environment.
    I have faced a problem for file upload from linux to windows and windows to linux
    And I have put crossdomain.xml file in root folder, still this problem is appear.
    Please help me, if anybody know the answer.
    Thanks and Regards,
    Senthil KUmar

    Hi Pauley,
    I thought you are moving from unix to windows. Now I got it.
    Make sure that the folder is shared and have necessary permissions. Please see few suggestions here:
    Re: NFS or FTP for file on Ip 10.x.y.z
    Regards,
    ---Satish

  • What is the difference between thread and task

    hi ,this is guruvulu bojja
    what is the diff between thread and task .
    can u give me the example for distinguish a thread and a task .
    How can i know thread is better than a task .
    please tell me what is the task in o/s level and task.
    <b>how the o/s distinguish a therad and task.</b>

    Hi Guruvulu,
    <b>Threads</b> enhance performance and functionality by allowing a program to efficiently perform multiple <b>tasks</b> simultaneously.
    In the case of <i><b>common memory</b></i> <b>threads</b> naturally have shared data regions while it has to be specially created and initialized for <b>tasks</b>.
    Simply put, a <b>thread</b> is a program's path of execution. It allows execution of two or more sections of a program at the same time.
    Regards,
    Pooja.

  • File from application server -Read and process and delete the file .

    Hi All,
             I writing a ZEE program which will read the file from application server(file will be in text delimat format) and moving the data to internal table and uploadind data base.The part which iam facing problem is -
    > I hve read the file from application server like below ,
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
    Spliting part i having problem .i need to seperate each field which is seperate from tab delimite and pass it into respective fields of internal table .
    Second if another file come to the appicaltion server , wether my first file will be there ? or should i need to delete the first file after redaing how should i proceed further ?.
    Regards
    SRIRAM...
    THANKS In ADVANCE

    HI,
    1.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    DO.
    CLEAR: wa_string, wa_uploadtxt.
    READ DATASET ld_file INTO wa_string.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    SPLIT wa_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_uploadtxt-name1
    wa_uploadtxt-name2
    wa_uploadtxt-age.
    APPEND  wa_uploadtxt TO itab.
    ENDDO.
    CLOSE DATASET ld_file.
    ENDIF.
    2. If the another file get's generated in the application server with same file name then the data in old file get's over written with the new data. You are not required to delete the file.

  • Hello!!!I need to read some data from the serial port and processing these, at the same time I want to see the process that I am doing.

    I read the data without problems, and I see them using Waveform graph, the problem is that I want to see the real time stamps, but in the graph appears 2:00:00,000 and 01/01/04, so the date and the time is wrong !!
    Can I change this?
    I am thinking that the problem is that I have to adquire the data and the time stamps ( using Get date/time) and after, I have to represent both!!!
    Thanks!!!

    Hello,
    As you probably know a waveform is made of a beginning time (t0), a time difference between each value (dt) and an array of values (Y). Your problem is probably that you don't initialize t0. Use the Vi 'Waveform->Build a waveform' to initialize the time of the waveform.
    Hope this helps !
    Julien

  • Printing problem from Adobe Acrobat 8 and Reader 9

    Hello together,
    i've got a problem while printing from Adobe Acrobat Professional 8 and Acrobat Reader 9.
    I've got the Error: /usr/libexec/cups/filter/pstoraster failed
    It happens with my new Canon ip4700 and my brother laser printer.
    I got the newest available Version of OSX and the Adobe Updates.
    The PDF files are printed in the "OSX Preview", but not in the Adobe Software
    Happy for any help or advice.
    Best,
    Lukasz

    Acrobat 8 and Reader 9 are not compatible. The only versions of Reader and Acrobat designed to be compatible with each other in Windows is Reader and Acrobat X.

  • Threads and Process

    Hi all,
    I want to fire particular processes using Runtime.exec() method. And these processes need to be suspended and resumed using Button Controls. Is this possible ? Mean, can I suspend a process if I click a Button on mu GUI ? It doesn't seem to be happening right now. Help please....

    When you use a thread you have control over the thread, but when you lauch a process you do not have control over that. If the processes you lauch have support OLE automation and the feature you want, then you can do some JNI coding and manipulate the process that way.
    If you want control, you are basically going to have to have objects that run in your treads or support some kind of interface that you can take advantage of.

Maybe you are looking for

  • "Day-Timer"  "Day Runner"  "Day Planner"

    Greetings, Thru out the afternoon, I have been playing hide-and-go seek in Goggle and Apple Discussions. I am searching for an Apple "Day-Timer" "Day Runner" "Day Planner" type product. I use iCal and Address Book ... they don't offer the variety of

  • Wrong date in file name when importing in Lightroom 5.0

    When I import files in Lightroom 5.0 and select the rename check box and use a custom template that includes the date (year, month, day) the files import with and incorrect date (not the current date).  The rest of the data in the file name from the

  • Problem with the browse sequence back and browse sequence next widget placed in the screen layout

    Hi, Some basics: We are using Robohelp 10 to  generate multiscreen  html5 output. We used the pharmaceutical  screen layout downloaded from:  http://helpx.adobe.com/robohelp/robohelp-screen-profiles-layouts.html but modified it to match our GUI. We a

  • *Killers scripts in databse not impacting in OBIEE - URGENT*

    We are enabling session killer scripts in database to kill the long running sessions (running more than 60 min), database script is killing those sessions however OBI reports/sessions are still running and it's creating new sessions in database. Howe

  • WinXP Crashed, need to transfer from iPod to new machine

    My copy of Windows XP Pro crashed, and now I want to transfer my music from my iPod to my computer, with a fresh copy of XP Home. Is there any easy way to do this? I saw a page on the Apple site that talked about switching to disk mode, but it's a li