How to design to end the threadpool program

hi,
I have a threadpool and submit a fixed no. of Runnables to it. But i want to know when all the submitted tasks are completed and to end the program. I don't think ending after submitting the last Runnable is a good solution. May i schedule another Runnable to check the size of the queue and end the entire program.
Thanks.
sorry for submitting in wrong category, should be in concurrency.
Edited by: itsraja on Apr 14, 2010 12:43 AM

Simply call [shutdown()|http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html#shutdown()] and then [awaitTermination()|http://java.sun.com/javase/6/docs/api/java/util/concurrent/ExecutorService.html#awaitTermination(long,%20java.util.concurrent.TimeUnit)].

Similar Messages

  • How do I set up the fax program so I can send faxes from my mac

    How do I set up the fax program so I can send faxes from my mac

    Do you have a fax machine or fax modem? If not, then you cannot fax over telephone lines, but you can subscribe to one of many eFax services.

  • How do I make Pages the default program for .doc files?

    How do I make Pages the default program for .doc files without having the need to change the default program for each individual.doc file?

    Navigate to a .doc file.
    Ctrl click the file
    Choose Open with and then go down the list, past pages, to other
    Navigate to pages
    Before you click Open make sure you click the 'Always open with' check box.
    You should be okay.
    You can do a similar think by selecting the file, Choosing File-Get Info
    Then open the Open With Disclosure triangle.
    select pages and then click CHANGE ALL
    Hope this hleps.
    M.

  • I'v just installed creative cloud 64 bit windows. How can I make bridge the default program to upload pictures rather than lightroom?

    I've just installed creative cloud 64 bit windows.  How can I make bridge the default program to upload pictures rather than lightroom?

    Usually the default program associated with an image file extension is an image developing Program like Lightroom or an image editing program like Photoshop. If you want to change the default associated program to Adobe Bridge you would use Window's Controls Panel file association applet.

  • How do you make ps6 the default program

    how do you make ps6 the default program

    I will let you know if works.  Thanks    BobC
    Date: Fri, 27 Sep 2013 11:17:43 -0700
    From: [email protected]
    To: [email protected]
    Subject: How do you make ps6 the default program
        Re: How do you make ps6 the default program
        created by gener7 in Photoshop General Discussion - View the full discussion
    Right-click on that saved image's thumbnail in Windows to bring up a menu.
    Select "Open with..." and from that "Choose default program"
    A box will open up with a list of Programs to  choose from. Photoshop CS6 64 bit should be in that list.
    Make sure "Always use the selected program to open this type of file" is checked.
    If you do not see it in the list, click the Browse button in this box and it will show folders in the Program Files directory. Double click "Adobe" then Photoshop CS6 (64-bit), then select Photoshop.exe and click "Open". It should add it to the list.
    Click OK and when you double-click on your saved file, it should open in Photoshop.
    Let me know if that worked for you or if you have other questions.
    Gene
         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/5719659#5719659
         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/5719659#5719659
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5719659#5719659. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop General Discussion 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.

  • How do I make Pages the default program?

    Hi,
    This may be quite basic, but I can't seem figure it out.
    I've just migrated from a PC to a Mac and I have a lot of .doc's. I want to make Pages the default program to open all of my MS Word documents; however, when I select >open with>other>iWork08>Pages, and check the "Always open with" option, it only opens that particular document with Pages, not every .doc file on my computer.
    Windows has an "always use for this type of file" option, but I can't find any such thing on my Mac. I have WriteRoom installed and this is somehow the (default) for .doc's, though, I didn't make it that way... just happens to show up first on the list for some reason.
    Thanks!

    Point to a .doc file in a window using the Finder. Command-i (or right click, then choose "get info") on any .doc file. Under "Open with" specify Pages then click "change all". This will make all .doc files open with Pages by default.
    If you don't like this setting, you can change it back. And bear in mind that opening a .doc file with Pages does not allow you to simply save the file using Pages. You have to save a second file in Pages format (and perhaps may wish to then delete the first .doc file). The fact that Pages doesn't save Word documents "natively" like this can be a pain, but there's no way around it because that's how Pages is designed.

  • Anyone know how to get out of the edge program?

    I dropped my old phone in the toilet and it was not time for an upgrade. Therefore, I went to the get a phone under the Edge Program. I specifically asked the rep at the store if I could go back to two year contract after I paid off the 50% of the program and he said yes. I hate this program. I only did it because I needed a phone and was not due an upgrade.  Now I understand that the only way I can get out of the Edge Program is to pay off the entire balance of the phone...which is outrageous. I no longer want to pay monthly installments. I want to pay a one time 2-year upgrade fee and start a new contract. It is my understanding my only choice is to pay off the entire edge or return the phone to Edge up. Problem is my phone has a small crack that I didn't realize was there until my son told me about it.  If you look at the phone normal you don't see it but if you look at it from an angle you can see the crack.
    I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack.  Otherwise, I would need to pay the insurance to get a new phone and then turn it in. This still cost me money. I am contemplating just paying off the rest of the balance and then maybe it will say I can get a new two-year contract, like it does for the other phones on my account.
    I have been a verizon customer way back when it was called Bell Atlantic Mobile and you would think they could do something for me since I have been a good customer all these years.  I don't want to leave because I have four other phones and a tablet with Verizon but I will if I have too. I would obviously go to AT&T. 
    Does anyone, maybe a verizon rep, have any options for me?

    rellis64 wrote:
    ... I only want to get out of Edge. I will have paid off 50% by January and want to go back to a normal 2-year agreement...but I do not want to return the phone although I will if I have to, that is if they will take it back with a crack. 
    Does anyone, maybe a verizon rep, have any options for me?
    I'm not a Verizon rep, just another customer like you. EDGE is a payment plan, or Rent to Own, or a lease program if you intend to keep upgrading.  If you want off the EDGE program, you can pay off the total balance due on the phone and keep it, and then you can start a new two year contract with a different phone. 
    In order to return the phone at the 50% point, and be done with EDGE, the phone has to be in good working condition.  The crack means it's not in good condition, so you will be charged the full price, whether you plan to EDGE up or go contract.  Either way, you'll end up paying for the EDGE phone, over time or in a lump sum.  It was one way to get a new phone when you were not eligible for the discounted price on your previous phone, but you need to fulfill that obligation before you can get another discounted phone.
    Do you want a new phone/different phone?  Look at eBay or swappa, or check with your friends who may have something you can borrow.  Or simply keep using the EDGE phone until it's paid for, then look at options at that time.

  • How to get data from the called program using SUBMIT in a background job?

    Hi Experts,
    I've a program which creates a background job using JOB_OPEN and JOB_CLOSE function modules.
    Between the above function modules I need to call a program using SUBMIT VIA JOB statement.
    My problem is, How do I fetch some data in an internal table in the called program to the calling program after the SUBMIT statement?
    I tried to EXPORT and IMPORT the data, but they are giving a failed sy-subrc when using this background job.
    Kindly let me know your inputs and valuable suggestions.

    Kumar,
    When we execute a program as a background job then the output will be sent to Spool which needs to be fetched again.I guess we need to use Submit via spool as mentioned by Rajat.
    Check these threads to get some idea
    submit report to spool & import spool id
    Re: Generate Spool for a report
    K.Kiran.

  • Before closing down the machine, how can I close all the open programs?

    Now that the iMac automauically starts up with the programs in use when closing, I find that this is delaying my start.
    There must be a shortcut to close all the open programs before closing the machine.
    Kindly advise.

    If by 'closing' the machine you mean shutting it down, there is a checkbox in the Shutdown confirmation window which is preset to re-start all apps at startup which were open when the machine was shut down. Uncheck that item in the Shutdown confirmation window.
    Unfortunately you'll need to do that each time you shut the machine down.

  • How do you globally change the default program for opening photo files?

    I want to adjust my system so that when I double click a photo file, Preview does not automatically launch.  I work in Photoshop all the time and would prefer that it be the default program for pictures.  I have already changed the "when you insert a picture CD" command in CD's & DVD's in System preferences but this does not have any effect on when I double click on a picture file to open it; Preview always launches and opens the picture there.  That automatic opening behavior is fine but I need it to happen in Photoshop.

    Assuming your pictures are all .jpg files: select any .jpg by clicking once on it in the Finder, then press Command+I to Get Info about it. In the Open With: section of the Get Info window, change the preferred application from Preview to Photoshop, then click the Change All button.
    Now any .jpg file that you double-click will open in Photoshop.

  • How do you uninstall just the mail program and reinstall

    i can not send or receive messages BUT I know my account is set up right cause i have used it for the last two years...ive only had this problem the last couple days.  I am thinking my mail program is corrupted and i want to reinstall it BUT dont know how.  OR does anyone have any other ideas why im not getting my mail or able to send it?  I have talked with my service provider and everything is fine on their end.

    Select Window ▹ Connection Doctor from the Mail menu bar. You should see a green dot next to each of the mail servers you've defined. Is that what you see? If not, click the Show Details button. A drawer opens at the bottom of the window. If there's text in that drawer, please post it. If not, click Check Again and post the text that appears. Edit out any personal information before posting.

  • How to get reults in the calling program that are returned by an API consol

    Hi,
    I am using a SPARQL query in a java program that is using a external API. The results are returned on console. I need to get results into some variables in my program so that I can use those further. There are 2 types of results returned; say one is name & other address. How can I do this.

    thanX a lot.
    Actually the method that is called to pass the query object in this statement:
    AGSparqlSelect.doSparqlSelect(sq);is
       public static void doSparqlSelect(SPARQLQuery sq) throws AllegroGraphException {
              if (sq.isIncludeInferred()) {
                   System.out.println("\nQuery (with RDFS++ inference):");
              } else {
                   System.out.println("\nQuery:");               
              System.out.println("  " + sq.getQuery());
              ValueSetIterator it = sq.select();/*@return; run SPARQL query, return an array
                                                      of result sets.  Each result set is an array of values.*/
              AGUtils.showResults(it);     
         }and this method actually returns the results on console which I need to get in some variables.
         public static void showResults(ValueSetIterator it) throws AllegroGraphException {
              String[] var = it.getNames();
             System.out.println("Number of solutions: " + it.getCount());
             for (int i=0; it.hasNext(); i++) {
                   ValueObject[] objects = it.next();
                   System.out.println("Solution " + (i+1) + ":");
                   for (int j = 0; j < objects.length; j++) {
                        ValueObject term = objects[j];
                        System.out.println("  " + var[j] + " = " + printValueObject(term));
         }So do you have any idea now how can this be done....?

  • How to compile and link the LabView program(G) with some function written in C?

    Before, some employee in our company developed some program which was written in LabView (G). Now we want to add some new function with has already been done in C++. Can we combine them together? how to do it?

    Hi;
    To use external code in LabVIEW, you can create a dynamic link library (.dll) that you can call from LabVIEW or a Code Interface Node (CIN). The instructions on how to make any of those are in National Instruments manual Using External Code in LabVIEW, which is included with LabVIEW, or you can download it from NI website.
    Also, in the knowledge base there is a "External Code for LabVIEW - CIN / DLL - Starting Point" page.
    If, on the contrary, you want to use LabVIEW code on your C application, you can build dll's in LabVIEW. Depending on your version of LabVIEW, you may need Application Builder to do so.
    Of course, you can also use other techniques like, for example, making that your LabVIEW application save the data in a file and then your C++ application read the file and continues from there, or vice versa. You can also use the "System Exec.vi" in LabVIEw to do that, assuming your C code is an executable.
    Regards;
    Enrique
    www.vartortech.com

  • How do I start using the example programs?

    Hi, I am trying to write a program/driver that will write and read from a couple analog output/input ports. I have a PCI-6220 and I'm running Slackware Linux.
    I've been trying to compile the examples (aiex2 is a good choice), but I can't figure out how to make it compile successfully.
    I do not consider myself a programmer (I'm a masters student of mechanical engineering), but I have modified drivers written in C for DOS before.
    Ultimately, I want to use my program/driver to control a physical system by using the analog output/input ports, and I want to do it as fast as possible. I want my program/driver to run as a real-time process.
    If there's a good reference for me to start reading, please send me a link. I can't find a good whitepaper or manual for writing drivers with the DDK.
    Thanks!
    -idbeu

    Hi,
    Here's a link to some MHDDK Knowledge bases:
    http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=2&filter=%2Btaxonomy:knowledgebase+%2Blanguage:en&q=MH_DDK
    I don't know if they'll address your partiucular problem.  If not, could you post the compilation errors you are getting.
    DiegoF

  • How can I transfer all the information (programs, files, etc..) from my ipad to my new ipad?

    Hello somebody can help me? I bought a new ipad and I need to transfer all the information, documents, etc.. from my old ipad to the new one how can I do that?

    You need to back up your current iPad either to your computer, or if you are on the cloud to the cloud.  Then when you go to set up your new iPad, you'll either restore it from the computer (iTunes backup) or if you back up to the cloud, wirelessly from the cloud.  The new device will give you the option to restore from a cloud backup if you are using the cloud.

Maybe you are looking for

  • Why does my 3rd Gen iPod Touch still play through the speaker when I plug my headphones in?

    When I plug my headphones into my iPod, it plays through them, but it also continues to play through the built in speaker. Does anyone know how this can be fixed? Thanks

  • Creative video converter problem

    when i first got my creative zen (just the creative zen) i could easy use yt downloader and put the videos on my player not when i use the creative video converter it would keep saying its unscessful at 36%. i tried a video at .9mb and it work but wh

  • Querying res column of RESOURCE_VIEW

    Mark , i want to create a resource on the repository, and then create views based on xpath, update some tables and then delete the resource. Now when i place the xml file in a xmltpye column every thing works fine. But it seems to be bit tricky wheni

  • Annotate pdf documents using the reader plugin in the browser

    Is it possible to annotate pdf documents using the reader plugin in the browser?

  • Export problem in Pro & AME

    I have a sequence that is getting hung up in the encoding phase in Adobe Media Encoder. A few hours ago, I was able to get it to render MOST of the file (it stopped 86% of the way through) encoded. Now, I am trying different variations (using AME ver