How to stop a process (that is executing)

Hi all
my question is How to stop a process that is executing ?
some other languages has a function called yield() in java how I can do it.
thanks

You can tell a Thread to yield - That is, cause the currently executing thread object to temporarily pause and allow other threads to execute.

Similar Messages

  • How to stop a process that i have started in my prog to stop

    public class stopproc {
         public static void main(String args[]){
    Runtime rt = Runtime.getRuntime();
    try{
    Process process = rt.exec("start notepad");
    //Thread.sleep(1000);
    //process.destroy();
    }catch(Exception ex){}
    The above is the code where i am starting a notepad and want to destroy it..but it is not working..can u tell me why

    //process.destroy();
    That won't do anything because it is a comment, not a line of code.

  • How do i stop two processes that are running in activity monitor

    how do i stop two processes that are running in Activity Monitor took one out of trash and it says preparing to move desktop still running with another one been running for hrs now want to stop these many thanks jen.

    Select each one and Force Quit it.
    But be careful there are many processes that are run by the OS that if quit will cause problems possibly even crash the system.
    regards

  • ADF how to display a processing page when executing large queries

    ADF how to display a processing page when executing large queries
    The ADF application that I have written currently has the following structure:
    DataPage (search.jsp) that contains a form that the user enters their search criteria --> forward action (doSearch) --> DataAction (validate) that validates the inputted values --> forward action (success) --> DataAction (performSearch) that has a refresh method dragged on it, and an action that manually sets the itterator for the collection to -1 --> forward action (success) --> DataPage (results.jsp) that displays the results of the then (hopefully) populated collection.
    I am not using a database, I am using a java collection to hold the data and the refresh method executes a query against an Autonomy Server that retrieves results in XML format.
    The problem that I am experiencing is that sometimes a user may submit a query that is very large and this creates problems because the browser times out whilst waiting for results to be displayed, and as a result a JBO-29000 null pointer error is displayed.
    I have previously got round this using Java Servlets where by when a processing servlet is called, it automatically redirects the browser to a processing page with an animation on it so that the user knows something is being processed. The processing page then recalls the servlet every 3seconds to see if the processing has been completed and if it has the forward to the appropriate results page.
    Unfortunately I can not stop users entering large queries as the system requires users to be able to search in excess of 5 million documents on a regular basis.
    I'd appreciate any help/suggestions that you may have regarding this matter as soon as possible so I can make the necessary amendments to the application prior to its pilot in a few weeks time.

    Hi Steve,
    After a few attempts - yes I have a hit a few snags.
    I'll send you a copy of the example application that I am working on but this is what I have done so far.
    I've taken a standard application that populates a simple java collection (not database driven) with the following structure:
    DataPage --> DataAction (refresh Collection) -->DataPage
    I have then added this code to the (refreshCollectionAction) DataAction
    protected void invokeCustomMethod(DataActionContext ctx)
    super.invokeCustomMethod(ctx);
    HttpSession session = ctx.getHttpServletRequest().getSession();
    Thread nominalSearch = (Thread)session.getAttribute("nominalSearch") ;
    if (nominalSearch == null)
    synchronized(this)
    //create new instance of the thread
    nominalSearch = new ns(ctx);
    } //end of sychronized wrapper
    session.setAttribute("nominalSearch", nominalSearch);
    session.setAttribute("action", "nominalSearch");
    nominalSearch.start();
    System.err.println("started thread calling loading page");
    ctx.setActionForward("loading.jsp");
    else
    if (nominalSearch.isAlive())
    System.err.println("trying to call loading page");
    ctx.setActionForward("loading.jsp");
    else
    System.err.println("trying to call results page");
    ctx.setActionForward("success");
    Created another class called ns.java:
    package view;
    import oracle.adf.controller.struts.actions.DataActionContext;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.model.generic.DCRowSetIteratorImpl;
    public class ns extends Thread
    private DataActionContext ctx;
    public ns(DataActionContext ctx)
    this.ctx = ctx;
    public void run()
    System.err.println("START");
    DCIteratorBinding b = ctx.getBindingContainer().findIteratorBinding("currentNominalCollectionIterator");
    ((DCRowSetIteratorImpl)b.getRowSetIterator()).rebuildIteratorUpto(-1);
    //b.executeQuery();
    System.err.println("END");
    and added a loading.jsp page that calls a new dataAction called processing every second. The processing dataAction has the following code within it:
    package view;
    import javax.servlet.http.HttpSession;
    import oracle.adf.controller.struts.actions.DataForwardAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class ProcessingAction extends DataForwardAction
    protected void invokeCustomMethod(DataActionContext actionContext)
    // TODO: Override this oracle.adf.controller.struts.actions.DataAction method
    super.invokeCustomMethod(actionContext);
    HttpSession session = actionContext.getHttpServletRequest().getSession();
    String action = (String)session.getAttribute("action");
    if (action.equalsIgnoreCase("nominalSearch"))
    actionContext.setActionForward("refreshCollection.do");
    I'd appreciate any help or guidance that you may have on this as I really need to implement a generic loading page that can be called by a number of actions within my application as soon as possible.
    Thanks in advance for your help
    David.

  • HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING IN THE PRODUCTION?

    HI ALL,
    CAN ANYONE TELL ME HOW TO STOP THE PROCESS CHAIN WHICH IS RUNNING DAILY AT 5.00 PM. I NEED TO STOP THE PROCESS CHAIN FOR COUPLE OF DAYS AND THEN RESTART IT AGAIN.
    cAN ANYONE TELL ME THE PROCEDURE TO STOP THE ENTIRE PROCESS CHAIN RUNNING IN THE PRODUCTION.
    THANKS
    HARITHA

    Hi,
    First and foremost let me advice you to be very careful while doing this.
    For Rescheduling
    RSPC> chain > Goto > Planning view and
    click on Execution tab > select > Remove from Schedule and then in Maintain variant of start process reschedule for the day you require it to run.
    For terminating active chain
    You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
    The next step will be to go to targets that you were loading and remove the red requests from those targets.
    Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
    But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
    Re: Kill a Job
    Re: Killing a process chain.
    Regards,
    JituK

  • How to stop the process chain showing status as yellow but no process step

    Dear Friends,
    How to stop the process chain showing status as yellow but no process step is running in that process chain.
    We have manually triggered the process chain for sales it finished successfully till load data but the next step is create index and DB statistics. Both of this steps are in unscheduled position only and no background job for this.
    Please guide me.
    Thanking you in advance.
    Regards,
    Shubhangi

    Hi,
      At times even I have faced this situation.  During those times, running the Function module RSPC_PROCESS_FINISH by passing the right parameters came to my rescue.
    Regards,
    Raj

  • How to stop a process chain when its running?

    Dear Experts,
    How to stop a process chain when its running? is it that a chain can be stoppend when we open an info package of that chain ?
    Thank you,
    Raj

    Hi,
    Goto the main menu process chain --> choose the remove from the Schudule...
    Regards
    sathis
    I hope it helps to u... please assign the points

  • How to Stop the process chain if it in the middle of the process?

    Hi,
    Is there anyway that i can stop the process chain if it is in the middle of the process already?
    Raj

    "Hi,
    First and foremost let me advice you to be very careful while doing this.
    You can start from SM37, find the process WID/PID then go to SM50 or SM51 and kill it. Once its done come back to RSMO and check the request, it should be red but again manually force to red and save by clicking on the total status button in the status tab. This shuld ensure that the process is killed properly.
    The next step will be to go to targets that you were loading and remove the red requests from those targets.
    Note: For source system loads you may have to check if the request is running in the source system and kill if needed and pull it again.
    But for BW datamart delta loads u may have reset the datamarts in case u are going to pull the delta again.
    Different Ways to stop process chain
    1)SM37 -->Kill Job
    2)SM50/sm66- ->Kill process
    3)RSPC>Job Log>Make the process RED forecefully.
    4)RSPC>Process chain> main Menu"Remove from Scheduling" OR
    5)se37-->RSPC_API_CHAIN_INTERRUPT
    give RFC BW system name(technical) and process chain name(technical)
    Steps 1 -3 stops the chain running in process
    Steps 4-5 stops the chain AFTER the current job which is running is completed as sucessful or Failure by nature.
    Rationale - 4-5
    This function will only remove the jobs from schedule, which did not yet run. It will not kill running jobs, as this may leave the system in an inconsistent state, moreover killing processes is possible for synchronous processes only anyhow. This means, that there will be no errors with interrupted chains, which on the other
    hand means an interrupted chain is not restartable. So for a running chain this function is intended to be an emergency break only. You can use it, however, to remove a scheduled chain from schedule, such that it does not start except by your product.
    Re: Kill a Job
    Re: Killing a process chain.
    How to stop a process in a process chain?
    Regards,
    JituK

  • How to stop a process in process chain

    Can anyboday help , How to stop a process in process chain .
    Thanks
    PP

    Hi Phani
    In RSPC, Open the Meta Chain, In Process Chain Manu bar,
    Select the option "Remove From Schedule"
    Hope this will help you
    Regards
    Saravanan.ar

  • I need to know how to stop a notification that keeps coming up when playing a spades game, that keeps telling me to go to the game center. I even shut off the notifications in the settings, this is an anoying problem

    I need to know how to stop a notification that keeps coming up when playing a spades game, that keeps telling me to go to the game center. I even shut off the notifications in the settings, this is an anoying problem

    I'm pretty sure this is an Apple thing and you can't do anything about it. To get rid of the notification just do as it asks then try to forget about it.

  • How to stop/cancel Process Chain in BI 7.0

    Hi,
    Could you tell me how to stop/cancel a process chain that hangs with status yellow or green in BI 7.0? There was an easy option to do it in 3.x, but I cannot find a similar option in 7.0.
    What happens is that at random our process chains hang at a certain variant with either yellow or even green status and do not proceed further. What happens is that in a couple of hours another pchain run occurs and it executes fine. Then again at random (might be the same day or the next day) the process chain hangs again. I think that all those "hanged" pchains pile up in the queue, so that it cause other future pchains to hang as well at some point. So, is there anyway to stop/cancel these zombie process chains when it stops at a particular event RSPROCESS in BI 7?
    Thank you,
    AG
    Message was edited by:
            AG

    Hi Frank,
    Thanks for your reply. I have a few questions.
    1)SM37 -->Kill Job
    We cannot do that because the job has already finished.
    2)SM50/sm66- ->Kill process
    There are no hanged processes to kill
    3)RSPC>Job Log>Make the process RED forecefully
    How do you do that exactly?
    4)RSPC>Process chain> main Menu"Remove from Scheduling"  OR
    5)se37-->RSPC_API_CHAIN_INTERRUPT
    give RFC BW system name(technical) and process chain name(technical) - we can do this,  but what exactly would it accomplish. Would it remove the process chain from any runs in the future or also any hanged ones in the past? An how is this step different from #4?
    Thank you,
    AG

  • How to stop a threads that makes I/O calls ?

    Hi,
    I've a business method that calls a Stored Procedure and makes lots of calculations. This method works inside its own thread, because I do not want to stop the GUI from accepting user actions.
    My problem is : this method may take from 5 minutes to 1 hour to process, depending on the size of the input. Sometimes, for any reason at all, the user may want to stop this execution (pressing a button on the GUI). How can I safely stop the thread ?
    I know I should not use stop() and suspend() because they are deprecated. And I do not use loops (remember it calls only a StoredProcedure that makes all processing), so I cannot use a variable nor interrupt(), because they do not work.
    Do you know any other way to stop this thread's execution ? By the way destroy() is not implemented.
    Thanks and regards.
    Bruno

    Are you saying that the 5 minutes to an hour is all spent in the stored procedure?
    If so the only real solution is to kill the statement - I'm not sure how the DB will handle that, but it will certainly free up your cycles.
    To do that without violating encapsulation, you just need to keep a reference to an object that knows something about the DB connection - you don't have to actually pass around the JDBC objects.
    Consider an object like this:
    public class DoLongProcedure {
       private Statement dbStatement;
       public double doLongCalculation() {
          dbStatement.execute(...);
          // etc
       public void interruptCalculation() {
          dbStatement.close();
    }You create an instance of this object and call its doLongCalculation() method to start everything. You have a reference to this object somewhere, because you are waiting for a response. When the user wants to cancel the process you just call the interruptCalculation() method.
    You have not violated your separation of functionality - if you find a new way to stop the process without killing the statement later, you just reimplement that method.

  • How to stop version check that happens in the background after timeout?

    Hi all,
    I have a problem that seriously makes my swing application (installed using webstart) very slow for some time.
    Steps to reproduce my problem :
    1. Deploy the jars of application in the web server running on Machine A( either in LAN or running on public IP).
    2. Download the application on Machine B using the link.
    3. Shutdown Machine A.
    4. Now try to start the application on Machine B. The starting of the application has become very slow.
    After some time(long enough) the application is started. Even now, the application is slow for first few minutes.
    Below is the part of jnlp that we used.:
    +<?xml version="1.0" encoding="utf-8"?>+
    +<jnlp spec="1.0" codebase="$$codebase" href="LaunchMyApplication.jnlp">+
    +<information>+
    +<title>My Application</title>+
    +<vendor>XYZ</vendor>+
    +<description kind="short">XXXXXXXX</description>+
    +<icon href="../../../../images/myapp_splash2009.gif" kind="splash"/>+
    +<icon href="../../../../images/myapp_logo.jpg"/>+
    +<offline-allowed/>+
    +</information>+
    +<security>+
    +<all-permissions/>+
    +</security>+
    +<resources>+
    +<property name="abc.type" value="client"/>+
    +<j2se version="1.5" initial-heap-size="48m" max-heap-size="256m"/>+
    +     +
    +     <!-- jar details -->+
    +     ...........+
    +     ..........+
    +     +
    +</resources>     +
    +<application-desc main-class="com.abc.xyz.Login">+
    +     <argument>..........</argument>+
    +</application-desc>+
    +</jnlp>+
    My assumsion is
    When I start my application, version checking will happen. But the cache server system(machine A) is not available. Due to this initial slowdown has occurred.
    After the timeout has occured, my application has started. Since the version checking continuous in the background, my application is again slow.(Even when my application server and database system are in the same LAN of my client machine).
    This slowdown is certainly not desirable.
    This slowness isn't there when there Machine A( in which my webserver is installed) is running and my webserver (Tomcat 5.0 in my case) is not started.
    Is my assumsion is correct?
    If correct, how do I stop version checking process that happens in the background after initial timeout?
    I think update check and policy attribute may not help me as I wanted to stop this background version check altogether. Also, my java sersion is 1.5_0_14.
    Please help me out in this.
    Thanks in advance..,
    Chakri.

    Talk to Apple here...
    http://www.apple.com/feedback/

  • How to stop a process?

    last time i selected all the files in a folder and expected them to open in one Preview window, but each opened a window and it took a long time. When this happens, how can i stop the process immediately?

    Quit the application using CMD+Q. If that doesn't work, OPTION-click the app's Dock icon, and select force quit.

  • How to stop a process after it was started with Process.Start

    I want my program to run other programs, but I also want the User to be able to stop the running program from within my program. How do you keep track of what program Process.Start has run?
    Robert Homes

    I want my program to run other programs, but I also want the User to be able to stop the running program from within my program. How do you keep track of what program Process.Start has run?
    The Start(String...) or Start(StartInfo) methods of the Process class are functions that return a Process object that you can then use to manage the process that you started, for instance to stop it with .Kill.
    https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx

Maybe you are looking for

  • How to determine mime type of multi-part message uploaded to rest api?

    I have a rest api that is used to upload data from different types of clients and serves as a proxy to write data to Azure blob storage. For testing, I'm using Fiddler on a PC. The code in my rest api that writes to blob storage looks like this: try

  • Analysis for Office support multi thread?

    Does Analysis for Office support multi thread/core? If so, what verison? I tried searching around this site as well as note 1466118 - Hardware & Software requirements for Analysis, edition for MS Office but was unable to find an answer. I am on an In

  • Mounting NTFS on OEL

    I have newly installed OEL R1 and im having problem on mounting my SDA1 and SDA2 NTFS partitions on linux. I have a dual booting systems. The OEL installations resides on Extended Partitions. mount -t ntfs /dev/sda2 /win/mpoint mount: unknown filesys

  • How do i apply a modified selection?

    hi i have an already existing selection. i would like to add to it. once i have drawn the new additional selection and selected the ADD TO SELECTION command how do i apply it? angus

  • Make a audio controller file move with a pan and zoom.

    I am using a few folio overlays for a digital publication. I have an image that uses the pan and zoom overlay. I would like to add several play buttons for audio that are linked to the image so when you pan the image the audio files move with it. So