Stop and start a thread

How do I stop a running thread and start it again. I tried interrupt() , sleep(100) and then tried to start it by start() but no luck.
any ideas please?

How do I stop a running thread and start it again. I
tried interrupt() , sleep(100) and then tried to
start it by start() but no luck.
any ideas please?You can't. Or well, you can by creating your own mechanism that would make the thread wait() on an object and then it notify() when you want it to continue. Read the API on Thread, especially about the deprecation of stop()/destroy().
Threads that have stopped execution (i.e. finished run()) cannot be restarted.

Similar Messages

  • Music skips and stops and starts

    Hello, we have just got a nano to replace a 3rd gen iPod.
    I have around 50 gigs of music on a lacie USB drive, and the music plays flawlessly from here in iTunes.
    However once imported into the nano, there is distortion, jumps and clicks in the music and sometimes the song will just stop and start from the beginning.
    Any ideas?

    Gary,
    You chould check out this thread we have going.
    http://discussions.apple.com/thread.jspa?threadID=356911&tstart=0
    Toshiba Satellite P25-609   Windows XP Pro   Media Center Edition iPod Nano 2G (as black as my cold, dead heart)

  • SSRS Report queries begin running slowly, have to stop and start report server to restore performance

    We have had a production issue crop up twice now where reports begin running slowly seemingly at random.  
    When this happens we can see from running SQL Profiler that the report queries are taking an extremely long time to execute.  The same queries when run directly in management studio run quickly.  
    Initially I suspected parameter sniffing, and tried using OPTION (RECOMPILE) in the reports, as well as clearing out the particular query from the plan cache and running the SQL in SSMS to try and get a better plan etc but no amount of jiggery pokery by
    me could get the queries to run any faster.
    The really weird thing - is that stopping and starting the report server via the reporting services configuration manager instantly cures the problem.  
    I'd really love to know - why this might be?  Is it something to do with the report server closing and re-opening its connections to the database? That's the only sort of thing I can think of...any ideas? Anyone? Any suggestions would be much appreciated.
    LucasF

    Hi LucasF,
    In your scenario, usually we can monitor the execution log in Report Database. If you run below query, you can get the results how long the report takes to render (TimeRendering), how long to process the report(TimeProcessing) and how long to retrieve data
    from Database(TimeData). You can check the starttime and endtime to know the total time for executing a report.
    SELECT TOP1000 *FROM[ReportServer].[dbo].[ExecutionLog2]
    More details information, please reference to similar thread below:
    Steps for troubleshooting a slow SSRS 2014 server
    Troubleshooting Reports: Report Performance
    In SQL Server Reporting Services, a job will be created by SQL Server Agent if any of the following processes is underway:
    query execution on a remote or local database server
    report processing
    report rendering
    To cancel a job that is running on the report server, we can cancel the job directly or reduce the report execution time-out value in the SQL Server Management Studio and then will stop query execution. Please refer to the steps below:
    Open SQL Server Management Studio, and connect to "Reporting Services".
    Under the Report Server node, right-click on the "Jobs" folder and select "Refresh". Then, right-click on "Jobs" again and click "Cancel All Jobs".
    Right-click on the Report Server node and open the "Server Properties" dialog.
    Click the "Execution" option, and set the "Limit report execution to the following number of seconds:" to a much smaller number. After this issue is resolved, this configuration should revert to the previous state.  
    Reference:
    Managing a Running Process
    Setting Time-out Values for Report and Shared Dataset Processing
    In addition, we can also use the KILL Transact-SQL statement to terminate a normal connection by terminating the transactions that are associated with the specified session ID. For the details information, you can refer to:
    KILL (Transact-SQL)
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • The sequence to stop and start xMII?

    Hi, good afternoon:
    Could anybody provide the sequence to stop and start xMII?
    Is it different from xMii11.* to xMii12.*?
    Thanks!

    Yes, the steps are same as what I suggested before.
    You can find plenty of material on SDN like blogs, articles, best practices and so on...
    The best place would be to start with is [MII WIKI|https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=15601]
    Below are few other very useful links,
    [Blogs|Weblogs related to SAP xMII; ( you can also find many blogs under category Manufacturing, xapps, mii etc.. on SDN)
    [Best Practices Guide|MII 12.X Best Practice Guide is now available;
    And also can find loads of threads on MII 12.x, 11.x installations/configurations/troubleshooting simply use large search date range.
    Hope this helps!!
    Regards,
    Adarsh

  • Script to Stop and Start Oracle Meter Data Management

    Hi,
    This is my first post in Oracle forums so if i open this in the wrong thread please forgive me.
    I tried to create a windows batch script to stop and start Oracle Meter Data Management but i can´t.
    @echo off
    D:\spl\MDMDEV\bin\splenviron.cmd -e MDMDEV
    D:\spl\MDMDEV\bin\spl.cmd stop
    D:\spl\MDMDEV\bin\splenviron.cmd -e MDMDEV
    D:\spl\MDMDEV\bin\spl.cmd stop
    The batch exits in the first command and i can´t understand why.
    Another thing is if i use spl.cmd stop command it doesn´t do nothing, is this normal?
    Thanks in advanced for all replies.
    Best Regards.
    Nuno

    I had to put a call command in mine. I think it is because you are trying to run a .cmd file within your bat file. You're actually changing shells. Thats why you need the call.
    call d:\spl\mdmdev\bin\splenviron.cmd -e mdmdev
    call d:\spl\mdmdev\bin\spl.cmd start
    I actually set mine up to use variables so all I had to change from script to script was the environment...
    <snip>
    SET SPLENV=MDMDEV
    SET INSTALLDRIVE=D:
    SET INSTALLDIR=SPL
    SET BINDIR=%INSTALLDRIVE%\%INSTALLDIR%\%SPLENV%\bin
    %INSTALLDRIVE%
    cd %BINDIR%
    REM Set envornment
    call %BINDIR%\splenviron.cmd -e %SPLENV%
    REM Wait a few seconds for environment to setup
    ping localhost -n 5 > nul
    REM Start SPL Web
    call %BINDIR%\spl.cmd start
    </snip>
    I was unable to find a way to get this to run as a service. Have you?
    I'm currently running these scripts in the startup/shutdown script section of the local machine policy (gpedit.msc).

  • Can Timers be stopped and started?

    Can Timer() objects be stopped and then restarted?
    Timer AttitudeIndicatorTimer = new Timer();
    AttitudeIndicator AttitudeIndicatorControl = new AttitudeIndicator();
    AttitudeIndicatorTimer.schedule(AttitudeIndicatorTask, 0, 500);
    I would like to be able to stop and start the above timer. If I use the cancel() method to stop the timer and then later the schedule() method to re-start the timer I get an error.
    Is there a way of starting and stopping these timers?
    I am fairly new to Java and this is the first time I have post a question on this fourm.
    I look forward to assistance on ths issue.

    I do have the API docs and was a bit surprised to see
    no way of temporarily stopping the timer.
    Does this mean I need to loo at Threads more closely,
    to acheive what I am trying to do, or is there
    possibly another way?What I would do is this: (1) to stop the timer, call its cancel() method; (2) to restart the timer, don't restart the timer but create a new timer with the same parameters.

  • Every video or podcast stops and starts every second

    Any help would be appreiciated, using Chrome, Windows XP Pro with SP3, Pentium 4 2.4GHz, with 2GB Ram, with Nvidia Gforce 5200 video card! Too old a system??

    hi, all three are pretty much the same, and its not a buffering issue. I hav Verizon Fios and had a WUGNET speed test show download speed being 11.3 Mbps and upload of 1.24. It was possible the Html was slightly better but not by much.
    Jim
    Date: Thu, 25 Oct 2012 15:22:01 -0600
    From: [email protected]
    To: [email protected]
    Subject: Every video or podcast stops and starts every second
        Re: Every video or podcast stops and starts every second
        created by Chris Campbell in Using Flash Player - View the full discussion
    That should be fine for system specs.  My first guess would be network bandwidth issues.  Does it seem like the video/audio buffers fast enough or does the buffer continue to run out when the item is played? Try these two links out, do either of them play better? HTML5 videoNon-HTML5 video Thanks,Chris
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/4801142#4801142
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4801142#4801142
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4801142#4801142. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Using Flash Player by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Order of stop and start of reporting services

    Hi All,
    I am using 11.1.1.3 version in my laptop,i want know the correct order of stop and start the services,please help me on this.
    Thanks
    Hypuser

    The full order list can be found at :- http://download.oracle.com/docs/cd/E12825_01/epm.111/epm_install/ch05s02.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How may I automatically stop and start Mail services at a set time please

    Hi folks. I was wondering if anyone could tell me how to automatically stop and start Mail services (or any other services) at a set time please in Leopard Server? Is there a script someone has created which might help?
    Cheers, David ( a realy newbie when it comes to administering OS X server)

    launchd works through a series of XML documents that define tasks to run, either at launch, on a time schedule, in response to network events, etc.
    So you'll need to create two .plists - one to start the mail server and one to stop it. They should be saved in /Library/LaunchDaemons. I'd suggest something like:
    /Library/LaunchDaemons/local.postfix.stop.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.stop</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>stop</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>1</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    and /Library/LaunchDaemons/local.postfix.start.plist:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple
    .com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>Label</key>
      <string>local.postfix.start</string>
      <key>ProgramArguments</key>
      <array>
        <string>/usr/sbin/serveradmin</string>
        <string>start</string>
        <string>mail</string>
      </array>
      <key>StartCalendarInterval</key>
      <dict>
        <key>Hour</key>
        <integer>4</integer>
        <key>Minute</key>
        <integer>00</integer>
      </dict>
    </dict>
    </plist>
    You'll need to either use launchctl load /Library/LaunchDaemons/local.postfix.stop (or start) to load the tasks, or reboot your server.
    I'm curious, though, as to why you want to do this. Mail is typically one of the services that people want to run 24/7 so they don't miss out on any emails (even though SMTP can tolerate this). Why do you want to shut yours down?

  • MacBook Pro hard disk stops and starts

    Why does the hard disk on MacBook Pro stop and start every 15 minutes or so? All operations suddenly stop for five to ten seconds during the spin down. I don't recall this happening in OS 10.5. The preference "Put the hard disk to sleep when possible" is NOT ticked, therefore the drive should never spin down.
    Any ideas?

    Try resetting your SMC.   Resetting the System Management Controller  >>
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G + 120G OCZ Vertex 3 SSD Boot HD 

  • APEX 4.2 aligning issue of Stop and Start Grid Layout item

    My APEX application application is in the process of moving from 4.0 to 4.2.  I am experiencing an issue with aligning (left margin justified) of Stop and Start Grid Layout items that have a border around them.  Earlier I had an issue with the border itself not showing up in the 4.2 application.  I was able to resolve that with a workaround by adding inline code in the CSS section of the page: #P23_OFFICE_START_TBL {width:682; border:1px solid #369; margin:5px;}. This created the border which I needed, but there are 2 Stop and Start Grid Layout items that are indented and not aligning with the border of the previous line.  I have tried a number of different things but none of them have worked.  This seems like a very simple issue to fix but I am having a tough time resolving it.
    I tried to put the item in question in a different grid, which corrected the indention but then I lost the border around the item.  It seems that the above CSS code does not work on the new grid.  I also tried to put attributes such as margin-left:5px; float: left; clear: left; float: left, in the CSS code but that did not work, too.
    Any suggestions?
    Thanks
    Ajay K

    I deleted and added back the Stop and Start Grid Layout items not aligning properly.  This worked.  Apparently, the 4.0 to 4.2 upgrade did not handle/convert these items properly.  Deleting and adding them back resolved the issue.

  • Burned DVD issues in DVD player not reading or music issues stop and start

    I'm a PC converted to a MAC (less than a month) and love it so far. I have been able to create and burn a DVD. The problem I'm having is one DVD player will not read the DVD (Hitachi). The other DVD player will play it, but the music stops and starts when it transitions (twirl) to another picture (Panasonic DVD/VHS combo). I'm using a DVD R Memorex. Neither one of the player are new. Would love to use this to make the Grandparent's a DVD of the grandchildren from birth to present as Christmas present. What do I need to use or do to be able to watch on any DVD player as well as the computers?
    Message was edited by: me01

    Hi me01
    Welcome to apple discussions. Try using 99 photos / less to avoid issues with audio fades / drops. Also do a search for Memorex on this forum and you'll see it's not the first choice of dvd's for most users. Instead try Verbatim, Maxell, or Taiyo Yuden and burn at 4x from a disc image for best results. Wish you luck and feel free to post back with results or any further questions.
    Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software / products that may be mentioned in this topic. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information above at your own discretion.
    Message was edited by: SDMacuser

  • Srvctl on 11.2.0.3 does not stop and start listeners

    I recently installed the Grid software under the "grid" user on RH5. Clusterware and ASM run under GRID_HOME, the single instance database runs under ORACLE_HOME. I have created 2 listeners on non-default ports (manually using entried in listener.ora) and then added to srvctl (srvctl add listerner -l LISTENER_XPT -o /app/oracle/product/dhome_1 -p "TCP:1523" -- in ORACLE_HOME.
    When stopping the listener using:
    oracle@#####>srvctl stop listener -l LISTENER_XPT -- note starting with oracle user in ORACLE_HOME. Below is from "/app/grid/product/11.2.0/grid/log/server_name/agent/ohasd/oraagent_grid/oraagent_grid.log
    2012-06-12 12:48:00.549: [ora.LISTENER_XPT.lsnr][1125030208] {0:0:1233} [check] (:CLSN00010:) TNS-00511: No listener
    2012-06-12 12:48:00.549: [ora.LISTENER_XPT.lsnr][1125030208] {0:0:1233} [check] (:CLSN00010:) Linux Error: 111: Connection refused
    2012-06-12 12:48:00.549: [ora.LISTENER_XPT.lsnr][1125030208] {0:0:1233} [check] (:CLSN00010:)Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1523)))
    2012-06-12 12:48:00.549: [ora.LISTENER_XPT.lsnr][1125030208] {0:0:1233} [check]
    **********FROM TAILING THE listener LOG ****************************
    TNS-01190: The user is not authorized to execute the requested listener command
    12-JUN-2012 12:44:12 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=v01orarac01w)(USER=grid))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER_XPT)(VERSION=186647296)) * status * 0
    TNS-01195: Listener rejected registration of endpoint "(ADDRESS=(PROTOCOL=TCP)(HOST=10.5.87.5)(PORT=1523)(IP=FIRST))"
    12-JUN-2012 12:50:02 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=v01orarac01w)(USER=grid))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER_XPT)(VERSION=186647296)) * status * 0
    TNS-01190: The user is not authorized to execute the requested listener command
    12-JUN-2012 15:12:58 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=v01orarac01w)(USER=grid))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER_ADMIN)(VERSION=186647296)) * status * 0
    12-JUN-2012 15:12:58 * version * 0
    12-JUN-2012 15:12:58 * service_register * LsnrAgt * 1195
    TNS-01195: Listener rejected registration of endpoint "(ADDRESS=(PROTOCOL=TCP)(HOST=********)(PORT=1524)(IP=FIRST))"
    12-JUN-2012 15:12:59 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=********)(USER=grid))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER_XPT)(VERSION=186647296)) * status * 0
    12-JUN-2012 15:13:05 * (CONNECT_DATA=(SID=PRDRAC01)(CID=(PROGRAM=perl)(HOST=********)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=*******)(PORT=41398)) * establish * PRDRAC01 * 0
    Why wouldnt the Oracle user not be able to start/stop a resource from ORACLE_HOME ? Any assistance would be helpful

    I just removed the listener out of the ORACLE_HOME and added it using srvctl to the GRID_HOME. Now I am able to stop and start.
    Still the question, why cant oracle user start an oracle_home managed resource. But the oracle user could start and stop using lsnrctl stop/start
    Below if the results from ps (note I just started listener from GRID_HOME):
    grid@PRODBLD:+ASM>ps -ef |grep lsnr
    grid 9114 1 0 09:40 ? 00:00:00 /app/grid/product/11.2.0/grid/bin/tnslsnr LISTENER_ADMIN -inherit
    grid 10348 1 0 Jun12 ? 00:00:00 /app/grid/product/11.2.0/grid/bin/tnslsnr LISTENER -inherit
    grid 20234 21990 0 09:49 pts/2 00:00:00 grep lsnr
    oracle 29926 1 0 Jun12 ? 00:00:00 /app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER_XPT -inherit

  • DVD will not stop and start in a Menue Mode

    Hello I am using DVD Studio Pro 4 for a school project and i am looking for some help with this problem.
    The DVD i have created plays and stops when i am watching one of my video tracks, i just can not start the DVD when i am previewing in any menue after i stop it.
    I have created my DVD with 16 menus and 2 video tracks. It burns and plays back fine but i can not stop and start the DVD when i am in a menu mode. The DVD will stop and play when i stop the DVD playing video from one of my video tracks but when i am in menu i push stop on my DVD controller and the DVD will not start back up. The DVD will look like it wants to play but it will not play. I have to open the DVD player tray open in order for it to start the DVD again.
    The DVD is a NTSC, SD, single layered 2.9GB
    Any help would be much appreciated, Thanks.
    Mike
    PowerBook G4 15 1.25 ghz   Mac OS X (10.3.9)  

    If only five months old it is still under warranty. Take it back.

  • Task created to stop and start Health service not working.

    We have multiple servers being grayed out so we created a task to stop and start the health service on SCOM 2007 R2. We have created two tasks one to stop and another task to start. The STOP task works but the START tasks keeps running but there is no result
    as well as when i check in Services.msc it is still stopped. Below are the screen shots .
    Task created to STOP the health service which is running.
    Screen shot of service start task creation which is NOT working
    The same was created for another service windows audio. Which worked for both stop and stop (Created separate tasks).
    We also tried the recycle health service and chche which is also failing.
    Can any one please help. The issue is on both SCOM 2007R2 and 2012 R2 both. Is there any other way to touch the health service.
    We are facing the issue only with Healthservice.

    Hi All,
    Thank you for all your answers.
    @ dktoa -
    You are right we have to concentrate on the servers to determine why do they go grey (all in one site). But before we do that i felt i find a temporary solution. Then go deep investigation to solve the issue.
    @Yan LI: As per the likn provided above you. I overrided the servers but still the health services were not starting or restarting. When i created a custom group and added the servers to that  group in that site and then  enabled the override on Restart
    Health Service for a specific group and pointed towards that group then it worked.
    Thanks All.

Maybe you are looking for

  • BlackBerry Travel no longer posting Trip Details to Exchange Outlook Calendar

    I have two users (BES) who use BlackBerry Travel quite often.  I verified this by looking at their calendars and by actually logging to to Outlook as them (since I am the admin). Prior to the problem every trip had details.  In other words, if you ha

  • WEP disables internet

    I have setup a linksys BEFW411s4v4 wireless b router. when i have the network open, no WEP required the wirless works perfectly. when i enable WEP, i can no longer connect to the internet. i have verified the correct WEP password, i am using 128-bit

  • How can a user scroll the resultset obtained from a servlet in a jsp page?

    Actually i am having a page where user has to select company name and for tht i am providing him with a button, and on clicking tht button a new search page is provided , and on mentioning the search criteria ,a servlet is fired which returns a list

  • Java dates from 0-11 or 1-12

    Hello In java Date, the months ranges from 0-11 . first january is thus 1/0/2003 (in dd/mm/yyyy form). But in almost all databases , month values are counted as 1-12 . That is first january becomes 1/1/2003 . Obviously we have to show the users month

  • Hidden Frames and Stokes in author

    Hi- I am thinking that the same hidden frames and strokes available to iwork 09 are available to ibook author. I am still trying to find the support files for author and see if they are there. If not it might be possible to copy them from iwork into