Starting thread numerous times

hi, i got the following code:
public class TestRunnerThread
  extends Thread
  private ThreadCheck test = null;
  public TestRunnerThread()
    test = new ThreadCheck();  // doesn't work - see run method.
  public static void main(
      String[] args_)
    TestRunnerThread runner = new TestRunnerThread();
    runner.start();
  public void run()
    while (true)
      try
        // ::NOTE:: thread only works with new instance - starting old thread
        // doesn't work anymore as soon as the thread leaves it's run method.
        // test = new ThreadCheck();  // this works
        test.start();
        System.out.println("waiting till join...alive:" + test.isAlive());
        test.join();
        System.out.println("sleep...");
        Thread.sleep(3000);
      catch (InterruptedException e)
        e.printStackTrace();
public class ThreadCheck
  extends Thread
  boolean tester = false;
  public ThreadCheck()
    tester = true;
  public void run()
    System.out.println("#test:" + tester);
    System.out.println("#..............");
}the ThreadChecker runs only if more than once if i create a new ThreadChecker object for every loop in the TestRunnerThread run method. although test.isAlive()) returns true even if i initialize the ThreadChecker only once in the TestRunnerThread run method which confuses me. isn't it possible to start the thread again as soon as it left the run method? and if so, why does it still say true for isAlive?
cheers,
mischka

Hi,
A thread that has terminated can't be re-started.
/Kaj

Similar Messages

  • I have installed Premiere Elements 11 from a disc I bought from Amazon.  I keeps asking me to re-install or if it does start stops a few minutes after I start a project.  I have a windows 8.1 PC.  I have tried numerous times to install the program and als

    I have installed Premiere Elements 11 from a disc I bought from Amazon.  I keeps asking me to re-install or if it does start stops a few minutes after I start a project.  I have a windows 8.1 PC.  I have tried numerous times to install the program and also to open it as Administrator as suggested by a friend but it still refuses to work.  I need direct help from Adobe but don't know how to get to them on this website as they seem to rely on user forums to advise customers.

    WhiteHouse Norm
    This question is already being responded to in the following duplicate thread
    Premier elements 11 keeps stopping
    Please reply in the other thread which has a discussion in progress.
    Thank you.
    ATR

  • HT6001 I have tried numerous time to update iTunes to Version 11.1.4.  Each time it has failed. I get the message of "This application has failed to start because MSVCR80.dll was not found".  Also I get a message of "Error 7". Advise please.

    I have tried numerous time to update iTunes to version 11.1.4.  It has failed every time.  Now I can't even get into iTunes on my PC.  The message I get is "This application has failed to start because MSVCR60.dll was not found.  Re-installing the application may fix the problem."  Okay. Which application?  What steps are needed for this process?
    Also, I get this message "iTunes was not installed correctly.  Please reinstall iTunes.  Error 7 (Windows error 126)"  Could someone please assist me in the steps necessary to remedy this issue.  Thanks.

    For many users at this point in time (iTunes 11.1.4.62) uninstalling iTunes alone is not enough and they may need to undertake further steps...
    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

  • Purchased ML 3 weeks ago from Apps store, started to download then stopped "an error has occurred" tried numerous times since but no success. The ML icon looks to start but says waiting and so am I. Any guidance appreciated

    Purchased ML 3 weeks ago from Apps store, started to download then stopped "an error has occurred" tried numerous times since but no success. The ML icon looks to start but says waiting and so am I. Any guidance appreciated.
    iMac-Mid 2007 MacOSX V 10.7.5

    maybe this will help:
    https://discussions.apple.com/message/19032230#19032230%2319032230
    https://discussions.apple.com/message/19107160#19107160

  • Over the years I have upgraded Photoshop numerous times.  When I click Start and Programs it shows P

    Over the years I have upgraded Photoshop numerous times.  When I click on Start, Programs is shows I have CS4, CS5 and CS6 installed.  If all three are installed, doesn't this eat up a lot of hard drive space?  If so, can I uninstall CS4 and CS5 and still have CS6 function properly?  Note - I am running the Windows 64-bit versions.  Thanks in advance for your help!

    Ravi,
    Will you please clarify how you recommend I uninstall CS4 and CS5?  Should I uninstall them through Windows or if I deactivate them while the program is open will that uninstall them?
    Sincerely,
    Randy Ballinger
    [email address removed]

  • Joining a Timer started thread

    Given a piece of code that uses a Timer to start a TimerTask, can the main thread get at the timer-started Thread so it can join() on it?

    thrice wrote:
    kajbj wrote:
    @Op.
    Why did you create a new Thread? Um, I'm not sure if you mean "thread" as in a new thread of Java code, or "thread" as in new topic on this forum!I meant thread as in topic.
    >
    I created new threads in my Java code because I need to get about 50 separate pieces of work done as concurrently as the hardware will allow, while still letting the main thread get work done.
    I created a separate topic in this forum because this is a specific question to which I'd like a specific answer!
    @All others. Please continue the discussion in the new thread [http://forums.sun.com/thread.jspa?threadID=5344116]
    Um, no, please answer this simple question in this thread! I don't know if join()ing to a Timer-started Thread object is the way to solve my overall problem. I suspect it isn't, and your suggestion to use a CountDownLatch reinforces that suspicion.A Timer is single threaded. It will not start 50 threads even if you have 50 timer tasks.
    >
    For my Java education, I'd like to know if I can join() to a Timer-started thread, and if so, how do I do it?See above.

  • I can't get my ICloud started. Each time i try to sign in..it indicates that theres a problem with my email apple address but never indicates what. I added a second email but the same result. Have changed my password numerous times...no result?????

    I have followed the instruction relating to Icloud connection.When i went to system preferences, my Apple address is continually rejected. I have added a second email as suggusted by an Apple site but i still get the same message. Im not told why the Apple ID/email is not accepted when it is accepted in all other Apple sites. I changed my password numerous times to ensure it wasnt the password but to no result. It continued to state that my Apple ID was the problem. I live in Malta,Europe. Have new Apple Mac Pro and Ipod. The annoying thing is that ICloud continually send me the problem notice but do nothing to tell me how to fix it? Can i switch this notice off? Help???????

    Welcome to the Apple community Yao.
    If you mean that Find My Phone is asking for a password to a different Apple ID to your current Apple ID.
    This feature has been introduced to make stolen phones useless to those that have stolen them.
    However it can also arise when the user has changed their Apple ID details with Apple and not made the same changes to their iCloud account/Find My Phone on their device before upgrading to iOS 7, or if you restore from a previous back up made before you changed your details.
    The only solution is to change your Apple ID back to its previous state with Apple at My Apple ID using your current password, you don’t need access to this address if it’s previously been used with your Apple ID, once you have saved these details enter the password as requested on your device and then turn off "find my phone" and delete the account from your device.
    You should then change your Apple ID back to its current state, save it once again and then log back in using your current Apple ID. Finally, turn "find my phone" back on once again.
    This article provides more information about Activation Lock.

  • I keep getting prompted to enter my Apple ID and password numerous times daily on both my iPad and iPhone.  This started happening after I installed the latest update. Any suggestions?

    Ever since installing the latest update to iOS 7.1.2 I am prompted numerous times daily to enter my Apple ID and password. I am having the same issue on my iPad 2 and my iPhone4. Any suggestions?

    First, if you still have access to the hacked account, rename it if you can and change the password for it.
    How to change the name you use for your Apple ID
    If needed, change the email linked to it as well.  Get control of that account back.
    As all iTunes purchases are linked to the account that purchased them (music, apps, etc) it is best to rename an account rather than creat a new account.  Apple ID's can't be deleted or merged either.
    From Frequently asked questions about Apple ID
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.
    If you need further Apple ID help, you will want to contact Apple, Apple ID Support
    or maybe iTunes Support
    ivan

  • Firefox will no longer start. Already updated, and now it will not start. Uninstalled, reinstalled (numerous times). Click the icon and nothing. Hour glass comes up for a second and then it is gone. Running XP ver 5.1 (service pack 3)

    Firefox will no longer run on my computer. It's been working fine up until a few days ago. Installed the updates and now nothing. Uninstalled, reinstalled (numerous times). Click the icon and nothing. Hour glass comes up for a second and then it is gone. Running XP ver 5.1 (service pack 3) edit. I'm no techie so I have no clue what is causing this or what to do. I love firefox and miss it greatly. Anyone know what I can do to get it back?

    Can you install a new profile? See [[Managing Profiles]] for me details and let us know if you need additional assistance.

  • TS3899 cannot receive or send email from my hotmail account, refuses to verify server. I have changed my password, deleted the account numerous times, any solutions? all on ios 6.

    cannot receive or send email from my hotmail account, refuses to verify server. I have changed my password, deleted the account numerous times, any solutions? all on ios 6. it was working up until a few days ago and now refuses to load on both my ipad 2 and iphone 4S
    in the process deleted all my contact, very annoying.
    all help is much appreciated.
    interesting that my gmail account does work perfectly.

    this may or may not help - but give it a try.  On a forum some were reporting that talk21 is now under the yahoo umbrella.  below are the steps this use listed.  (This was an android forum, but the email settings should be the same.  In short it looks like their server names have changed.  An existing account may have simply been forwarded - but if you are reinstalling, it may want a clean install to the right servers.)  Pay particular attention to the server names and port settings.  (this thread was started based on a discussion of Imap vs pop - you are already an Imap person - so ignore that part)
    See if this helps.
    why settle for pop3, when IMAP works with talk21 and not only does mail get pushed out faster with IMAP, but when you click refresh it will be received faster than pop3.  The other advantage is subfolders are also supported with IMAP but cant be seen with POP3. This mail feature works with my android eclair & hero phone and the settings are exactly the same for win mobiles also (not tested). The mail setting up roadmap is the same from what i can remember once in the mail feature for win mobi. 
    This is what you need to do to setup Talk21 email with IMAP. 
    Incoming server settings
    IMAP server - imap.mail.yahoo.com
    Port - 143
    Security type - none 
    Outgoing Server settings
    SMTP server - smtp.mail.yahoo.com
    Port - 25
    Security type - none Also important note - Enable 'require sign-in'
    and enter your talk21 username and password The End...works a treat for me p.s. Its only taken me 3 years to work it out with win mobile and recently with android. Finally got it to work...hope this helps all the talk21 users out there. if there are any other similar posts out there with no answer...dont forget to mention my name when passing this post around.

  • After recent upgrade to Yosemite on Macbook air bluetooth audio cuts out and associated video stops with audio. Likewise with airplay and Apple TV. I have deleted all my saved wifi connections and restarted numerous times. I do not expect a resolutio

    After recent upgrade to Yosemite on Macbook air bluetooth audio cuts out and associated video stops with audio. Likewise with airplay and Apple TV. I have deleted all my saved wifi connections and restarted numerous times. I do not expect a resolution from the community, but hope to get the attention of Apple engineers. If you are having same problems or have a miracle cure I am all ears.

    May start my own thread, but I'm having similar issues.
    I've been using an old iMac (running 10.7.5) and Apple TV for years with no issues. Last week I bought a new Macbook Pro running Yosemite and have had audio issues multiple times. The weird thing is that sometimes it works flawlessly, other times (like now) I spend half an hour just trying to get a song to play.
    My issues are: When I got to "computers" in Apple TV to stream my music, my music is sometimes chopper or intermittent, and I seen to know when it's going to happen based on the status wheel just before it plays. When I choose a song, the status wheel will spin for an unusually long time, usually an indicator that the audio is either not going to work, or stutter.
    When it does finally pull up a song, the playhead sits at the beginning of the song for a good 3-5 seconds before actually playing. Then, when it starts playing, it's all downhill. It will play a few seconds, drop out, play a few more seconds, drop out, and then ultimately the playhead will keep moving across the song as if it's playing, but there's no audio.
    Again, this is a new phenomenon never experienced by me. I've tried everything I could think of, some of them all at once:
    • restart Apple TV
    • restart Macbook Pro
    • quite iTunes/open
    • turn off Home Sharing on iTunes then reconnect it
    • unplugging and cycling both my modem and router
    None of these have alleviated the problem.
    The odd thing is, like this morning, the audio started up perfectly and never gave me any issues. It wasn't until later in the day that it started. Perhaps after the macbook pro had been put to sleep? Not sure.
    Regardless, this is an annoying trait, one that's new to me and my system (as stated, worked flawlessly until my new purchase), and is 100% limited to either a) the macbook pro b) Yosemite or c) both of them.

  • Editing Loop Start and End times via automation / MIDI controllers?

    I'm trying to play a sample in EXS24 and have the Sample Start, Loop Start and End times manipulated over the course of the song. I've tried to open up the EXS sample editor, click on the numerical value of the Loop Start, and then attempt to Learn Automation. All it does is assign the knob for the instrument Volume Level. Is there any way to do this? It's basically how an Akai S612 works: http://www.vintagesynth.com/akai/s612.shtml
    I switched gears and tried it also with Battery, and there's a way to map the Start and End times in there, but it's not seeming to work as I've intended. I can't seem to make the loops move as they should and there's ways to use up to 4 loops, but not a way to target each loop's start and end points via separate controllers.
    I could use my S-612 [and probably will], but in moments where I don't have one available, I'd love to find a solution to this.
    Thanks,
    +odd

    Anyone with any thoughts? would be great to solve this.

  • I have uninstalled and reinstalled itunes numerous times and keep getting the message it reinstalled incorrectly stating windows Error 127.

    I have uninstalled and reinstalled itunes numerous times and keep getting the message it reinstalled incorrectly stating windows Error 127.  I am using windows 7

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    You may have more success if you use the advice in the Install missing components section to break down the installer into its component .msi files and install these in alphabetical order.
    tt2

  • I have installed Adobe Reader 11.0.07 for Mac OS 10.9.3. Have asked this question numerous time without results. The problems I am having are: I cannot scroll using the side slider on downloaded PDF files, nor can I fill in fillable files. Also, and this

    I have installed Adobe Reader 11.0.07 for Mac OS 10.9.3. Have asked this question numerous time without results. The problems I am having are: I cannot scroll using the side slider on downloaded PDF files, nor can I fill in fillable files. Also, and this is extremely irritating, I cannot re-initialize the same file or initialize and another PDF file after I have initialized the first file. If you cannot help please let me know if should use an earlier  version of Reader or find anther company that has the appropriate software.

    Perhaps you missed that you started a discussion at I have OS 10.9.2 and have downloaded latest version of Reader 11. I can no longer fill in form or scroll using the side bar. and you did not respond to the last post there.

  • Flashplayer will not install. I have completed the automatic and manual installation numerous times but Firefox still says it is missing.

    I have installed the Adobe Flashplayer 10.3 add-on numerous times, both manually and automatically. However, Firefox will not recognize the installation. How can I remedy this problem?

    There's two different versions of Flash. One for IE and another for most other browsers.
    1.Download the Flash setup file from here: <br />
    [http://fpdownload.adobe.com/get/flashplayer/current/install_flash_player.exe Adobe Flash - Plugin version]. <br />
    Save it to your Desktop.<br />
    2. Close Firefox using File > Exit <br />
    then check the Task Manager > Processes tab to make sure '''firefox.exe''' is closed, <br />
    {XP: Ctrl+Alt+Del, Vista: Shift+Ctrl+ESC = Processes tab}
    3. Then run the Flash setup file from your Desktop.
    * On Vista and Windows 7 you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). <br />
    See this: <br />
    [http://vistasupport.mvps.org/run_as_administrator.htm]

Maybe you are looking for

  • My iPhone is no longer downloading mail messages

    I have both my work e-mail and Gmail on my iPhone.  For some reason, my work e-mails are no longer automatically being pushed to my phone unless I click on the Mail icon and wait for it to connect/download.  This isn't the case for my Gmail...and my

  • Apple's e-mail stopped working early this morning.

    This morning around 2:15am (EST), something changed with my Apple mail, and it cannot be accessed via any method (Mac Mail, iPhone, iPad, or even directly with the iCloud website.) Cannot send or receive.  My other non-me.com accounts work fine. All

  • Mapping problem question

    Hello, I am new to XI. I am working on XI 3 sp-9. I have configured an outbound interface with a JDBC adapter and an inbound rfc/bapi interface. I made some mappings between the message type which holds the database record and the bapi (bapi_requsiti

  • IPod Classic 160GB-Splits Complilation Albums into single songs

    Just afer adding a couple of compilation albums to iTunes library.Albums intact on iTunes but after syncing to my iPod all comp albums are split into individual songs.how can i filter/sort albums to make them intact without having to delete artist na

  • Any Idears on how to use my D-Link Router with Print Server on my mac ?

    I just got recently a D-Link Router with Print Server. The Model is a DI-704UP. does anyone know how i can access the printer to my G5 ? talked to D-Link and Apple and they have no solution. IMac G5   Mac OS X (10.4.6)