Running child thread till completion even after main thread is terminated

I am running some task in background using Task and Service Api's. When the main application spawns few threads, can the main thread be terminated without terminating the child thread. Is it possible. Thanks.

Read up on daemon threads.
multithreading - What is Daemon thread in java - Stack Overflow
Also read the
  Application Lifecycle section in the javadoc.

Similar Messages

  • HT3964 My computer freezes after running for about 15 min even after setting the energy saving to 3 hours

    My Mac computer freezes after running for 15 min even after seeting the energy saving to 3 hours. Any ideas how to stop the freezing/

    Hi Teodorafrombc,
    Thanks for visiting Apple Support Communities.
    If your computer is becoming unresponsive, you may want to see if specific applications are causing this behavior. Try using the Force Quit menu to check for unresponsive applications:
    Using the Force Quit feature of OS X makes an application close, even when it is not responsive.
    Important: Normally you should not need to force quit an app to close it. When an app is forced to quit, any unsaved changes to open documents are not saved, so try these methods to normally close the app first:
    Choose Quit from the app menu. For example, in Safari, choose Safari > Quit Safari.
    Choose Quit by right-clicking or control-clicking on an app's icon in the Dock
    You can find the article with these steps here:
    OS X: How to quit an unresponsive application using Force Quit
    http://support.apple.com/kb/ht3411
    If your display is going blank or seems to be going to sleep unexpectedly, try these steps first:
    Reset the system
    You can reset the Mac's parameter RAM and SMC.
    You can find the article with these steps and more information here:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    If these steps don't resolve the issue, feel free to reply with more information about the symptoms you are experiencing.
    Best,
    Jeremy

  • Thread 1 Queue:com.apple.main-thread???

    Having trouble with the Thread 1 Queue: com.apple.main-tread....

    What kind of problem ?
    You need to explain what you are trying to do and what is failing.
    Your screenshot is showing the default unit test class created when setting up a unit test - you may consider reading about unit testing to understand what's going on.
    Session 409 "Testing in Xcode 5" from the WWDC 2013 videos introduces this subject - they can all be found on Apples developer site:
    https://developer.apple.com/
    The most recent guide about unit testing that I can find is:
    https://developer.apple.com/legacy/library/documentation/DeveloperTools/Conceptu al/UnitTesting/00-About_Unit_Testing/about.html#//apple_ref/doc/uid/TP40002143
    this is out of date (it applies to Xcode 4) but still relevant, the main difference (from what I understand) is that Xcode 5 starts you out with a test target and that test functions are now named as XCTxxx() instead of STxxx() as the underlying test system has been changed from previous sentest/ocunit/octest to xctest.

  • MacBook Pro Retina showing spinning ball issues even after Main Logic Board Replacement

    HI there!
    I'm a proud owner of Macbook Pro, 15 inch, late 2013 model. It has 2.6 GHz Intel Core i7 processor; 16 GB Ram, 1 TB PCIe based SSD. The software version is OS X 10.9.4. I have AppleCare.
    1. MY mac developed rainbow beach ball issues. Sometimes it'll last for ages. I took several videos of them. I spent hours chatting with online Apple advisors. They did everything they could possibly do: Repair Disk, Repair Disk Permissions, SMC reset, PRAM reset. When nothing worked, I did clean-install the Mac six or seven times. Every time other apps would randomly cause the spinning ball issues. My Mac even restarted all on a sudden because of kernel panic. So at last, I took it to an Apple Store which is a one-mile drive from London. They diagnosed it as a graphics issues and replaced the Main Logic Board and put it to standard testing which revealed no other anomalies.  After the repair, I noticed that dock icons remain present for a dew seconds when I restart or shut down the computer. So this time I took it to a London Apple Retail Store. The Genius at first diagnosed it as a display burn-in issues and sent it to be replaced with a new one. However, next day the technician who actually worked on the computer, phoned me saying that they could not reproduce any issues and did not replace the display either. I went to take my Mac back and discovered that the dock icons stuff still persist when restarting or shutting down the Mac. When I drew their attention, they told me that it was a software issue that Apple is aware of. Apple might resolve the issues in the future updates. Well, after getting back to my hotel room, I clean-installed my OS  from USB and the dock icon issues were gone. Same version of software, but different behavior.
    2. But that's not the reason I'm here. My Mac has again begun to show the rainbow beach ball one day after the repair, when I try to connect to my Airport Time Capsule through Finder in order to selectively transfer files to my Mac. This time the spinning ball would last for a very short time. But if I want, I can regularly reproduce them. I've also noticed this when installing MS Office for Mac 2011 edition. I'm sure I'll get the nasty ball as I use the Mac more and more.
    3. I've got some questions: Can it be that during the MLB replacement, some other connectors got harmed? Or the issues are not specific to graphics only? Why didn't Apple find any anomalies during testing? I'll go to Apple Retail Store again, when I get the chance to. Once there, can I ask them for a full replacement of the Mac? Shall they take my request otherwise? I really don't feel comfortable using a shouldered computer which is going to go through many parts replacements.
    4. I sincerely need your feedback. Please help me guys out there.

    Applecare was no help at all. I called and did the complaint. They confirmed that it is registered to me and everything but essetially told me that they cant give me answers as to what is taking so long. They knew a repair was in progress but wanted to set me up with an appointment at an apple store? (the nearest Apple retail store is Billings which is 240 miles away, or about 4 hours). i tell them its at the repair place and they go on to tell me they can send me a box to mail it in and have it reapir by them.. They are trying to shift the blame to the AASP and his rep. But he said he has been trying with very few answers from Apple as well

  • When syncing after recent update, sync is stuck at "Step 4 of 4" "Waiting for changes to be applied" and will not complete, even after hours.  How can this be fixed?

    I completed the most recent software update for both iTunes and iPhone recently.  I am now trying to sync my iPhone to add newly purchased audiobooks and the sync remains stuck at "Step 4 of 4" with the message "Waiting for changes to be applied"  I have tried everything to correct this.  When sync is cancelled a failure to sync message is generated.  Any ideas????

    Alright, so I reset my computer and suddenly it then recovered. Other times it wouldn't recover after resetting the computer, so I have no idea how it happened. I just restarted the computer lots of time and finally it worked.
    Okay, back to square one. Now to transfer music, I tried my previous acknowledgable solutions but they didn't work. The iPod touch does not feature a hard-disk mode, and windows media player doesn't support iPods.
    I've tried multiple programs to transfer music but none of them work properly and keep giving me error codes. So my iPod still gets stuck at Step 4: Waiting for changes to be applied or whatever it said.
    Thanks in advance ._. (Please help)
    p.s - Apple is useless. If I don't get steady answers tomorrow I'm going to end up calling them and get this problem fixed first hand. Second hand? I don't know, over the **** phone.
    juiceb0xk signing out for the night. Bye. >:(

  • On my laptop I cannot open up Mozilla browzer because it say it is allready running, but it is not even after shutting computer off an restarting. How do I turn it off

    I cannot get on line because it states it is already running. This has happened before and it tells me I should restart computer which works, but this weekend it has not worked and it keeps telling me it is still working. This is not the laptop that I am having trouble with that is why I can ask my question. The one with the problem is Windows XP. Now every time time I go to open the browser it looks like it is starting up and then nothing no matter how long you wait

    Do a clean (re)install and delete the Firefox program folder (C:\Program Files\Mozilla Firefox\).
    Download a fresh Firefox copy and save the file to the desktop.
    * Firefox 8.0.x: http://www.mozilla.com/en-US/firefox/all.html
    Uninstall your current Firefox version if possible.
    *Do NOT remove personal data when you uninstall the current version or you lose your bookmarks and other data in the profile folder.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    Your bookmarks and other profile data are stored elsewhere in the Firefox Profile Folder and won't be affected by a reinstall, but make sure that you do not select to remove personal data if you uninstall Firefox.
    You can force Firefox to create a new default profile if you remove the profiles.ini file.
    * http://kb.mozillazine.org/profiles.ini_file
    You can find that file here:
    C:\Users\<user>\AppData\Roaming\Mozilla\Firefox\
    The "Application Data" folder in XP/Win2K and the "AppData" folder in Vista/Windows 7 are hidden folders.
    *http://kb.mozillazine.org/Show_hidden_files_and_folders
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Firefox states it is already running yet won't open even after I uninstalled and reinstalled

    Hi,
    I was having problems with Mozilla when I'd go to Facebook it would show the page but within seconds I would get check6 (can't remember the rest) error page.
    So I went to help, restart Firefox. It was at this for about an hour and I knew there was a problem so chose to end process in task manager.
    Since then I haven't been able to open Firefox:
    "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system".
    I uninstalled Firefox using Revo Uninstaller and deleted all leftover files, restarted my computer and installed Firefox, but the problem still remains.
    I tried looking through previous questions and noticed I do no have a profile folder which may be needed to delete a lock file....
    Any help much appreciated! thanks

    I had this problem yesterday, actually. You can solve it, but you will lose all firefox data you didn't back up. Then again, because you already tried uninstalling and reinstalling, I assume this isn't an issue.
    Assuming you've installed windows on the C drive:
    Go to C://Users/yourname/AppData
    If you cant find it, go to your display settings (I hope I translated this correct; I use the Dutch version of Windows) and make sure that hidden files and filders are not being... well, hidden. Shocking plottwist, I know.
    If all goes well, you should now see three folders named Local, Localrow and Roaming.
    Now go to Roaming > Mozilla > Firefox and delete everything thats in there. Now you have an empty FireFox folder, which will force Firefox to start up as if it was never installed before.
    Done! :)
    P.S. Now that you have a fresh new install, save yourself a lot of future pain and install [https://addons.mozilla.org/firefox/addon/xmarks-sync Xmarks] for your bookmarks and [https://addons.mozilla.org/firefox/addon/lastpass-password-manager LastPass] for your passwords. These add-ons will keep your data safely on their servers, where it is yours to backup and download anywhere in the world.
    Also, if you have about three milion add-ons and personas/themes and you don't want to hunt hem down again everytime you reïnstall Windows or buy a new system, get [https://addons.mozilla.org/firefox/addon/febe FEBE] to save a copy of them for you. And if you really want to backup like a pro, install [https://www.dropbox.com/ DropBox] (not an addon) and tell FEBE to store its files there, so you can still retrieve them if your house happens to burn down.
    Xmarks, LastPass and FEBE: the holy trinity of Firefox backups :P

  • Previously running CS4 won't open, even after script clean and reinstall

    I can't get in!....
    Seems like a license issue.
    After trying all (7) of the fixes in kb405970 recommended by Adobe tech support, I was unable to get access to my previously working CS4 Production Suite products. I removed the entire program and ran CS4 Clean Script for Macintosh, then reinstalled Production Suite.
    Now, when I try to get into any of the products, i get a registration screen that accepts my VALID and REGISTERED (from the Adobe Registration site) CS4 Prod Suite serial number, and NOTHING happens. No programs open.I can't get any response from Adobe tech support for the last 10 days. Case has been open since October 18. I'm just diving into asking for help in a forum.
    HELP! Please

    I had this problem yesterday, actually. You can solve it, but you will lose all firefox data you didn't back up. Then again, because you already tried uninstalling and reinstalling, I assume this isn't an issue.
    Assuming you've installed windows on the C drive:
    Go to C://Users/yourname/AppData
    If you cant find it, go to your display settings (I hope I translated this correct; I use the Dutch version of Windows) and make sure that hidden files and filders are not being... well, hidden. Shocking plottwist, I know.
    If all goes well, you should now see three folders named Local, Localrow and Roaming.
    Now go to Roaming > Mozilla > Firefox and delete everything thats in there. Now you have an empty FireFox folder, which will force Firefox to start up as if it was never installed before.
    Done! :)
    P.S. Now that you have a fresh new install, save yourself a lot of future pain and install [https://addons.mozilla.org/firefox/addon/xmarks-sync Xmarks] for your bookmarks and [https://addons.mozilla.org/firefox/addon/lastpass-password-manager LastPass] for your passwords. These add-ons will keep your data safely on their servers, where it is yours to backup and download anywhere in the world.
    Also, if you have about three milion add-ons and personas/themes and you don't want to hunt hem down again everytime you reïnstall Windows or buy a new system, get [https://addons.mozilla.org/firefox/addon/febe FEBE] to save a copy of them for you. And if you really want to backup like a pro, install [https://www.dropbox.com/ DropBox] (not an addon) and tell FEBE to store its files there, so you can still retrieve them if your house happens to burn down.
    Xmarks, LastPass and FEBE: the holy trinity of Firefox backups :P

  • Firefox is running but will not open even after re-installing

    I have tried re-installing firefox but it still won't open. If I go onto task manager I can see that it is running in the background. I am currently using google chrome as my default browser.

    I have three computers that are practicably clones of each other and the new itunes update failed on two of them but one worrked fine. Here is fix that worked for me. This fix was suggested by another member but I cannot recall or find his post. My system is WinXP sp3 with all the latest patches.
    1. Download AirPort Utility 5.5.1 for Windows http://support.apple.com/downloads/
    2. Open task Manager and stop the mdnsresponder process. The corrupted mdnsresponder will be using 50% of your cpu.
    3. Open control panel / add remove programs. Find the bonjour app and click on it.
    4. Note the corrupted version of bonjour 2.0.0.34 by clicking on the support link.
    5. Uninstall bonjour
    6. Restart Windows.
    7. Install the AirPort Utility. This will install a good working version of mdnsresponder. Restart windows again.
    8. Upon restart you will see a new the airport icon in your task tray. You can also find mdnsresponder.exe running under process in task manger with little or no cpu usage. Your bonjour app under add remove panel will now be version 1.0.106

  • I am trying to update my iPad to ios5 but backup never completes even after 24 hours attached to iTunes? Frustrated. Any ideas?

    Trying to back up ipad in order to upgrade to ios5. I have connected for over 24 hours and shows it is working but never completes. Don't know what to do. Any ideas?

    Temporarily disable your firewall and security software and see if that helps.

  • N900 Running Slow slow slow! - even after PR1.2 - ...

    My N900 is running very slow, to the point where typing does not keep up, beeps/alerts stutter and button presses take so long that I sometimes wonder if I have pressed them.
    Have updated PR1.2 with the help of Cpitchford but still my device is painfully slow.
    Don't have many apps installed but something must have messed things up somewhere along the way. Have attached a Conky screenshot if that helps.
    Should I re-flash or is there another way?
    Solved!
    Go to Solution.
    Attachments:
    Screenshot-20100529-125738.png ‏59 KB

    it only backs up the list of applications (not the actual applications themselves, hence you will have to redownload the apps), communication and calendar data, some settings, and bookmarks.
    not too sure about sms or emails, perhaps they are included in the 'communication and calendar' section of the backup. no guarantees here.
    it DOES NOT back up all your music and video. logically, it makes no sense that 27gigs of data could be compressed into 5mb...
    if you want to back up all the data, you will need to either copy it to a computer, copy it to multiple microsd cards, or run the backup tool via ovi suite beta (or a compatible pc suite if one exists). 

  • My computer said fire fox is running and wont shut down even after you shutdown the cumputer and start it back up

    when i try to open ff it says to close it first but i have not open it yet

    See:
    * http://kb.mozillazine.org/Profile_in_use
    * https://support.mozilla.com/kb/Firefox+is+already+running+but+is+not+responding

  • Firefox always says using old version even after running the upgrade programme. Even after uninstalling & reinstalling? Why?

    Every time I open Firefox the message "using old version" appears I have tried uninstalling the program and then reinstalling but no change, When I use Firefox as my browser a message appears to say you are using an old version of Firefox. This is just fustrating what can I do to correct?

    Try resetting your User Agent:
    *[https://support.mozilla.com/en-US/kb/websites%20or%20add-ons%20incorrectly%20report%20incompatible%20browser#w_reset-your-user-agent Reset your user agent]
    *[http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default Resetting your useragent string to its compiled-in default (Mozillazine)]
    *What is a User Agent: http://en.wikipedia.org/wiki/User_Agent
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • Why can't I interrupt the main thread from a child thread with this code?

    I am trying to find an elegant way for a child thread (spawned from a main thread) to stop what its doing and tell the main thread something went wrong. I thought that if I invoke mainThread.interrupt() from the child thread by giving the child thread a reference to the main thread, that would do the trick. But it doesn't work all the time. I want to know why. Here's my code below:
    The main class:
    * IF YOU RUN THIS OFTEN ENOUGH, YOU'LL NOTICE THE "Child Please!" MESSAGE NOT SHOW AT SOME POINT. WHY?
    public class InterruptingParentFromChildThread
         public static void main( String args[] )
              Thread child = new Thread( new ChildThread( Thread.currentThread() ) );
              child.start();
              try
                   child.join();
              catch( InterruptedException e )
    // THE LINE BELOW DOESN'T GET PRINTED EVERY SINGLE TIME ALTHOUGH IT WORKS MOST TIMES, WHY?
                   System.out.println( "Child please!" );
              System.out.println( "ALL DONE!" );
    The class for the child thread:
    public class ChildThread implements Runnable
         Thread mParent;
         public ChildThread( Thread inParent )
              mParent = inParent;
         public void run()
              System.out.println( "In child thread." );
              System.out.println( "Let's interrupt the parent thread now." );
              // THE COMMENTED OUT LINE BELOW, IF UNCOMMENTED, DOESN'T INVOKE InterruptedException THAT CAN BE CAUGHT IN THE MAIN CLASS' CATCH BLOCK, WHY?
              //Thread.currentThread().interrupt();
              // THIS LINE BELOW ONLY WORKS SOMETIMES, WHY?
              mParent.interrupt();
    }

    EJP wrote:
    I'm not convinced about that. The wording in join() suggests that, but the wording in interrupt() definitely does not.Thread.join() doesn't really provide much in the way of details, but Object.wait() does:
    "throws InterruptedException - if any thread interrupted the current thread +before+ or while the current thread was waiting for a notification. The interrupted status of the current thread is cleared when this exception is thrown."
    every jdk method i've used which throws InterruptedException will always throw if entered while a thread is currently interrupted. admitted, i rarely use Thread.join(), so it's possible that method could be different. however, that makes the thread interruption far less useful if it's required to hit the thread while it's already paused.
    a simple test with Thread.sleep() confirms my expected behavior (sleep will throw):
    Thread.currentThread().interrupt();
    Thread.sleep(1000L);

  • Module status on LMS is showing as incomplete - even after the user has completed the module.

    Hi Folks,
    Hope you are all keeping well! I have a bit of a problem here. On a number of modules that were developed using presenter - and custom animation (including click next to continue) etc etc, the LMS is not showing the module status as complete - even AFTER the user had comleted the module and closed. This problem has been noticed only when the user uses the CLICK NEXT or click this part of the screen to continue.
    When the user navigates using the presenter control buttons - to navigate the training content that is, the LMS is correctly showing as the module has been completed.
    The problem I am having is that - is there any way to make presenter detect a click within a slide (user click to navigate from within a slide) and thereby register it as a valid module completion?
    Thanks in advance folks,
    Kind Regards,
    Alex.

    Hi Shubi,
    Thanks for you quick reply.
    Shubhi Shukla Dubey wrote:
    Hi Alex,
    Which LMS server you are using?  Secondly what is the Setting in Quiz>Reporting tab is it SCORM 1.2,2004 or Aicc.
    You want status on basis of user clicks then please make sure that Report data is set to "Slide view =100%" (or whatever precentage you want) and  Report Pass/Fail set to "Complete/ Incomplete."
    Thanks,
    Shubhi
    LMS = cornerstone on demand. It has been customised to suit the company requirements, Reporting tab is SCORM 1.2   
    To circumvent the issue I have changed the % view to 0% so in theory when the user launches even one slide / page - it will set it to report as status complete.
    However this is not a viable solution on content critical modules....dont you think so?
    Ideally I would like to get to the bottom of why a button within the module (which is able to navigate between pages) is not being able to report / set / increment the completion status counter.
    Thanks and Kind Regards,
    Alex.

Maybe you are looking for