Main thread is busy, cannot receive callbacks

Hi,
I'm using the measurement studio activeX control to program my application. (NI-DAQ 6071E) My main thread is always busy because there's a lot of calculating and graphing. I'm using the CWAI control to do continuous caputuring. When the program is very busy for displaying the data, it will miss the callbacks or give error. My question is, is it possible to create measurement studio controls in a worker thread, so that the callbacks will be recieved in the worker thread? If not possible, is there any work around? I tried to use windows messageas to get around. The program is it still need to go through the main thread. The bottom line is callbacks cannot have anything to do with main thread. Thank you.
Dona
ld Yeung
Software Engineer
Tensor Biosciences

In general, free threading in Visual Basic 6 is not supported. If you can't take no for an answer, though, check out Chapter 13 of Advanced Visual Basic 6 : Power Techniques for Everyday Programs.
Another option would be to upgrade to VB.NET. For more information, see HOW TO: Create Threads in Visual Basic .NET and INFO: Roadmap for Threading in Visual Basic .NET.
- Elton

Similar Messages

  • TS2755 My sister and I have/had an iPhone this week she upgraded and went to an android. Now she cannot receive my text. I have put her phone number as a mobile device. Deleted previous iMessages and started a new thread she still cannot receive my text.

    My sister and I have/had an iPhone this week she upgraded and went to an android. Now she cannot receive my text. I have put her phone number as a mobile device. Deleted previous iMessages and started a new thread she still cannot receive my text. Please tell me how this can be resolved

    the fastest way is to call applecare and they can remove her number from iMessage/facetime.

  • So my iPhone 4S started draining battery after recent update, battery got changed and it worked perfect for 3 days, all of a sudden the phone won't stay on unless connected to mains... Cannot receive any signal "searching" constantly. HELP

    So my iPhone 4S started draining battery after recent update, battery got changed and it worked perfect for 3 days, all of a sudden the phone  shut down and now won't stay on unless connected to mains... Claims its at 100% battery but thats impossible as it was at 30% before it shut down randomly.
    Cannot receive any signal "searching" constantly.
    Turns off as soon as removed from usb ... wont stay on connected to laptop!
    HELP!

    The iPhone includes a one year warranty. If an Apple store is not nearby, you can call AppleCare and handle an exchange under warranty over the phone. The exchange will be shipped to your door - someone must sign for the delivery so if no one will be at home, have it delivered where you work. You use the same box to return the existing iPhone back to Apple. Return shipping label and tape to reveal the box incuded - call the carrier with number incuded when the box is ready to be picked up. AppleCare will request a credit card in the event the existing iPhone is not returned within 10 days after the exchange under warranty is received.
    Hardware can fail - it happens, which is why there is a one year warranty.

  • How to hold the main thread, till response is received from the server?

    I have a program in which the GUI client(View program in Swings) sends a request to server (Manager program) , and waits for the response from Manager.
    The method used is waitForResponse() as follows
    <code>
    private void waitForResponse()
    m_blWaitFlag=true;
    //after response from manager m_blWait flag is set to false.
    while (m_blWaitFlag)
    try
    Thread.sleep(500);
    }catch(Exception r_ex)
    </code>
    And in notifyResponse() method, the wait flag is set to false
    as in,
    <code>
    public void notifyResponse(VcvResponse r_objResponse)
    m_blWaitFlag = false; //this line makes the thread to come out of the wait mode.
    </code>
    When I click a menu item, this request is sent and there is a wait for a response from manager.
    The problem is , this kind of waiting makes the system slow, and grey patches are seen immediately after clicking a menu item.
    Are there other ways of waiting??
    Thanks in advance

    When I click a menu item, this request is sent and there is a wait for a response from manager.This means you are using the GUI thread to send the request.
    The problem is , this kind of waiting makes the system slow, and grey patches are seen immediately after clicking a menu item.This means the GUI thread is waiting for the response. No GUI updates can occur while it is waiting.
    Are there other ways of waiting??Use another thread. e.g the main as you suggested. If you are using a callback, why do you have a thread waiting at all? WHy not do the things you would do when a response comes back in the call back?

  • How to unjam my ipad? I cannot receive but can send so have to use main pc to receive

    I sent many photos to friends yesterday morning suddenly I noticed that I no longer receive mail into my inbox and the sent box was also frozen to that point. I can however still send more photos but had to go to my PC to receive my emails as I c.c. myself into all the emails I sent.  Is the ipad jammed because I sent too many phtos at one time? 

    You're funny, but also on my website and I do not bother you, who are you?
    发自我的 iPhone
    在 2014年11月7日,下午4:22,Apple Support Communities Updates <[email protected]> 写道:
    Apple Support Communities
    Gobilow has posted in the Using iPad community.
    How to unjam my ipad? I cannot receive but can send so have to use main pc to receive
    I sent many photos to friends yesterday morning suddenly I noticed that I no longer receive mail into my inbox and the sent box was also frozen to that point. I can however still send more photos but had to go to my PC to receive my emails as I c.c. myself into all the emails I sent.  Is the ipad jammed because I sent too many phtos at one time?
    To post a reply, go to the discussion in Apple Support Communities.                                                             
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM. Cupertino, CA 95014.
    All Rights Reserved | Privacy Policy | Terms of Use | Apple Support

  • JMS error- Exception in thread "Main Thread" java.lang.NoClassDefFoundError

    Hi guys,
    I am new to JMS programming and i'm have the following error...I have set up a simple weblogic server on my local machine and i am trying to send a message to a queue i've created on a JMS server. I am trying to manually run an example provided by BEA WebLogic... the code follows.
    //package examples.jms.queue;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.util.Hashtable;
    import javax.jms.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    /** This example shows how to establish a connection
    * and send messages to the JMS queue. The classes in this
    * package operate on the same JMS queue. Run the classes together to
    * witness messages being sent and received, and to browse the queue
    * for messages. The class is used to send messages to the queue.
    * @author Copyright (c) 1999-2006 by BEA Systems, Inc. All Rights Reserved.
    public class QueueSend
      // Defines the JNDI context factory.
      public final static String JNDI_FACTORY="weblogic.jndi.WLInitialContextFactory";
      // Defines the JMS context factory.
      public final static String JMS_FACTORY="weblogic.examples.jms.QueueConnectionFactory";
      // Defines the queue.
      public final static String QUEUE="weblogic.examples.jms.exampleQueue";
      private QueueConnectionFactory qconFactory;
      private QueueConnection qcon;
      private QueueSession qsession;
      private QueueSender qsender;
      private Queue queue;
      private TextMessage msg;
       * Creates all the necessary objects for sending
       * messages to a JMS queue.
       * @param ctx JNDI initial context
       * @param queueName name of queue
       * @exception NamingException if operation cannot be performed
       * @exception JMSException if JMS fails to initialize due to internal error
      public void init(Context ctx, String queueName)
        throws NamingException, JMSException
        qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
        qcon = qconFactory.createQueueConnection();
        qsession = qcon.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        queue = (Queue) ctx.lookup(queueName);
        qsender = qsession.createSender(queue);
        msg = qsession.createTextMessage();
        qcon.start();
       * Sends a message to a JMS queue.
       * @param message  message to be sent
       * @exception JMSException if JMS fails to send message due to internal error
      public void send(String message) throws JMSException {
        msg.setText(message);
        qsender.send(msg);
       * Closes JMS objects.
       * @exception JMSException if JMS fails to close objects due to internal error
      public void close() throws JMSException {
        qsender.close();
        qsession.close();
        qcon.close();
    /** main() method.
      * @param args WebLogic Server URL
      * @exception Exception if operation fails
      public static void main(String[] args) throws Exception {
        if (args.length != 1) {
          System.out.println("Usage: java examples.jms.queue.QueueSend WebLogicURL");
          return;
        System.out.println(args[0]);
        InitialContext ic = getInitialContext(args[0]);
        QueueSend qs = new QueueSend();
        qs.init(ic, QUEUE);
        readAndSend(qs);
        qs.close();
      private static void readAndSend(QueueSend qs)
        throws IOException, JMSException
        BufferedReader msgStream = new BufferedReader(new InputStreamReader(System.in));
        String line=null;
        boolean quitNow = false;
        do {
          System.out.print("Enter message (\"quit\" to quit): \n");
          line = msgStream.readLine();
          if (line != null && line.trim().length() != 0) {
            qs.send(line);
            System.out.println("JMS Message Sent: "+line+"\n");
            quitNow = line.equalsIgnoreCase("quit");
        } while (! quitNow);
      private static InitialContext getInitialContext(String url)
        throws NamingException
        Hashtable<String,String> env = new Hashtable<String,String>();
        env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
        env.put(Context.PROVIDER_URL, url);
        return new InitialContext(env);
    }when i run the main method with args[0] = "t3://localhost:7001", i get the following errors:
    Exception in thread "Main Thread" java.lang.NoClassDefFoundError: weblogic/security/subject/AbstractSubject
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at QueueSend.getInitialContext(QueueSend.java:122)
    at QueueSend.main(QueueSend.java:91)
    Could someone please help. thanks.

    when i run the main method with args[0] = "t3://localhost:7001", i get the following errors:
    Exception in thread "Main Thread" java.lang.NoClassDefFoundError: weblogic/security/subject/AbstractSubject
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)
    at QueueSend.getInitialContext(QueueSend.java:122)
    at QueueSend.main(QueueSend.java:91)
    Could someone please help. thanks.This is Java 101:
    http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/rtrb_classload_viewer.html
    You've got to have the WebLogic JAR that contains the necessary .class files in your CLASSPATH when you run.
    Don't use a CLASSPATH environment variable; use the -classpath option when you run.
    %

  • I cannot receive email properly now. When I open mail, it says that is downloading about 1,700 emails. At the very end, it gives me my newest ones. But this takes a long time. I've contacted the Internet service provider and verified all the right setting

    I cannot receive email properly on either my IPad or my IPhone. I have had them for over a year and they have always worked fine. Until three days ago, when they both started acting up. On the IPad, when I open mail, it says it is downloading about 1,700 emails. At the very end, which takes quite a while to get to, I finally get the most recent ones. The IPad is sending emails just fine.
    On my IPhone, when I open mail, it says it is downloading 100 emails, but it doesn't do that. And it gives me no new emails at all. The IPhone is sending email just fine.
    I have already deleted the email accounts on both devices and reinstalled them. I've contacted the Internet service provider and verified all the right settings. The Outlook email on my desktop is working perfectly.

    WMV is a heavily-compressed format/CODEC, and the processing time will depend on several factors:
    Your CPU, which is not that powerful in your case
    Your I/O sub-system, which is likely a single HDD on your laptop
    The source footage. What is your source footage?
    Any Effects added to that footage. Do you have any Effects?
    Each of those will have an impact on the time required.
    The trial has only one main limitation - the watermark. Now, there are some components, that have to be activated, but are not with the trial, but they would be evident with Import of your source footage, if it's an issue.
    Good luck,
    Hunt

  • 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.

  • I have 3 mail accounts in apple mail. One of them has had the spinning ball going for several days and I cannot receive mail in this account. I can receive mail in this account on my iPad and by signing into aol on safari. It's obviously a glitch in Apple

    I have 3 mail accounts in apple mail. One of them has had the spinning ball going for several days and I cannot receive mail in this account or delete messages etc. For some  reason, I CAN send mail on Apple mail using this account, although it takes several minutes. I can receive mail in this account on my iPad and by signing into aol on safari and internet explorer on my office PC. It's obviously a glitch in Apple's Mail. I've deleted this account and reopened it in Mail on my Mac Pro with no difference. Any suggestions would be greatly appreciated, this E amil account is major to my business.

    http://support.apple.com/kb/TS3276
    sounds like a corrupt database or index
    the glitch is your home folder and mail folder, esp look at syncservices
    I'd post in the mail or Lion forum where you will find similar issues being discussed.
    http://www.apple.com/support/mail

  • I can send, but cannot receive E-Mail, suddenly.

    I am a new convert to the entire world of Apple, aside from a longtime Safari proponent and user. A month and a half ago, I purchased a MacBook Pro 15" (you all know the specs, I went with 512 g flash drive upgrade) and am extremely happy with it. I have Windows 7 x64 installed on a 200g partition, solely so I can continue to use a few SONY apps that I need for video and audio editing for my business. These apps are NOT available for Apple machines and are essential to my photo restoration and video transfer and editing business. Ok, that's the environment.
    Yesterday, as I normally do, I woke up, coffee, check on all of my animals, Mac starts with scheduled start-up at 7:20am as per usual while I am busy with my 'wake up' duties. After the wife was off to work and I was ready to check E-Mails and check for any correspondence from clients, I open 'mail,' (I have it set to start at scheduled start-up) and notice there is no E-Mail in my two pop accounts. I have a Gmail account and the iCloud account. 'This is odd.' I invoke 'receive' a couple times. Nothing. I turn on my phone (Blackberry) and it starts making noise as it normally does when E-Mail comes in. This is weird. I reboot my lovely Mac. No joy. No E-Mail. So I start troubleshooting. I figure out that I can send from all four accounts but cannot receive on any of them.
    I reboot to the Windows partition. I open Live Mail. It fills up on my two pop accounts. Even more weirder. I have the Gmail account on this partition also, but it rarely receives E-Mail so it can wait. No iCloud on the Windows side. We all understand that.
    On the Apple side, I removed all accounts from mail and re-established them with no resulting solution being apparent.
    I have made no changes at my account on the server (webhero.com) so I am baffled. I looked for solutions here, but have found nothing, which is why this is being written.
    Because I have seen no solutions, I consider that something unique has occurred to my computer that is not a new issue with many other Mac users.
    My system is updated to all recent standards so there isn't much more to post
    Any ideas, anyone?
    Thanks for looking,
    Kelly J.

    Personally I will never leave Windows behind. Mac just doesn't cut it for me. For one it is to much of a closed system and the door is closing even more as I type this. MS isn't that much better with the release of Win 8 (which I will not be using at all except for Tech supporting others).
    Apple does not like to give the user options and if they do you have to know the command line to implement them, in some cases. In others there simply is no user choice, like sounds for events.
    With the advent of the newer Mac's with Non upgradeability, IE the retina models and the newest iMacs, this is certainly not the systems for me.
    The OS? Well IMHO OS X isn't any better then Windows and in most case I like Windows better. IMHO Windows is an easier system to use. Not sure about Win 8.
    Been running Windows for 20+ years and I can count on one hand the number of BSODs I've had. But then I run Clean system and the desktops I built myself. Notebooks are mostly Dell Business line models and my one MBP.
    BSODs happen from bad hardware or drivers for that hardware. OS X is slightly better but Apple is not immune from writing or using bad drivers and the hardware is no better built then most any Windows PC. It just comes in a different case.
    Apple Lived on the "It Just works" saying for a long time. That is not the case today, as you may see from all the posts in all the Apple hardware forums.
    I'm Fixento get back to work, Y'all. Ga day.

  • How to make the main() thread wait?

    I would like to know how to make the main() thread wait for another thread?If I use wait() method in main() method it says "non-static method wait() cannot be referenced from a static context",since main()
    is static.

    Here is an example how you may wait for a Thread in the main -
    but be careful, this is no real OO:
    public class WaitMain {
    // this is the thread class - you may also create
    // a runnable - I use a inner class to
    // keep my example simple
         public static class ThreadWait extends Thread{
              public void doSomething(){
                   synchronized(syncObject){
                        System.out.println("Do Something");
                        syncObject.notify();
              public void run(){
                   // sleep 10 seconds - this is
                   // a placeholder to do something in the thread
                   try{
                        sleep(10000);
                        doSomething();
                        sleep(10000);
                   catch(InterruptedException exc){
    // this is the object we wait for -
    // it is just a synchronizer, nothing else
         private static Object syncObject = new Object();
         public static void main(String[] args) {
              System.out.println("This will start a thread and wait for \"doSomething\"");
              ThreadWait t= new ThreadWait();
              t.start();
              synchronized(syncObject){
                   try{
    // this will wait for the notify
                        syncObject.wait();
                        System.out.println("The doSomething is now over!");
                   catch(InterruptedException exc){
              // do your stuff

  • This relates to an earlier question I asked:  I have an iPhone and can send messages to a galaxy phone but the person cannot receive them; however, I can send them and it sounds like they are sent, but are not received.  I can get them from a galaxy.

    This relates to an earlier question I asked:  I have an iPhone and can send messages to a galaxy, but the person cannot receive them; however, I can receive messages from the galaxy.  I have only had an iPhone so the problem does not relate to a change in phones.  Up until about 1month ago I could send to the galaxy and they could be read.  Help!

    Hi there nancyfrompilot mountain,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    If the issue occurs with a specific contact or contacts, back up or forward important messages and delete your current messaging threads with the contact. Create a new message to the contact and try again.
    If the issue occurs with a specific contact or contacts, delete and recreate the contact from the Contacts app. Send a new message to the contact.
    Back up and restore your iPhone as new.
    -Griff W. 

  • Blocking the applet and main threads ?

    The thread that runs the Applet callback methods like init() and start() is a thread named �applet-your.package.your.classname.class�.
    If I am doing a blocking method call, i.e. a method call that does not return immediately like doing I/O read on a socket connection, is it ok to do it on the thread mentioned above ? In other words, is it ok to hang/suspend/block the applet thread ?
    What about blocking the �main� thread that calls
    public static void main(String args[]) {�}
    Thanks.

    eminformatics, thanks for the reply.

  • What exactly is the main thread?

    please consider this code:
    public class Foo {
        public static void main(String[] args) {
              ((Foo) Thread.currentThread()).bar(); // <--- error. see stack trace below.
        public void bar() {
            System.out.println("--bar()--");
    }stack trace: Exception in thread "main" java.lang.ClassCastException: java.lang.Thread cannot be cast to testingarea.Foo
    So what does this say about the main entry thread? is it an instance of "Foo"? or an instance of java.lang.Thread? If an instance of "Foo" why can't I invoke an instance method on the return value of "Thread.currentThread()"? If the main thread is an instance of java.lang.Thread, then where is the:
    "public void run();" method?
    While I can't think of any practical usage of this knowledge yet, but I'd still like to know. Thanks.
    Edited by: outekko on Mar 17, 2010 6:38 PM

    joshg_75 wrote:
    You should always refer to the javadoc for infomation of a method and its usage. In this case, refer to the javadoc of the Thread class.
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html
    I suggest you also read up on usage of threads.Can you please share a little of your expertise in threads?
    Remember this is the "New To Java" forum, and I am just a beginner as you discovered. Any help from experts would be embraced. Before you became a thread expert, you must have started somewhere. I don't need immediate assistance, but whenever you get the time, why not cut/paste this into your IDE and take a look.
    public class Main {
      static ObjectOutputStream oos;
      static ObjectInputStream ois;
      public static void main(String[] args) {
        try {
          PipedInputStream pin = new PipedInputStream();
          PipedOutputStream pout = new PipedOutputStream(pin);
          oos = new ObjectOutputStream(pout);
          ois = new ObjectInputStream(pin);
          new OutThread().start();
          for(;;) {
            Thread t = (Thread) ois.readObject();
            t.start();
        } catch (Exception e) { e.printStackTrace(); }
          public static class OutThread extends Thread implements Serializable {
            public void run() {
              System.out.println("OutThread::run--> id# " + this.getId());
              try { Thread.sleep(1030); } catch (InterruptedException e) {  }
              try {
                oos.writeObject(this);
                hangAround();
              } catch (Exception e) { e.printStackTrace(); }
            public void hangAround() {
              for (;;) {
                System.out.println("_____waiting around... id# " + this.getId());
                try { Thread.sleep(5030); } catch (InterruptedException e) {  }
    }Not only do I appear to serialize instances of threads, the threads are actually running . So, does a live thread have private, non-transient, "state" that needs to be persisted? If so, why does serialization work? If not, why not write in the API that java.lang.Thread implements Serializable ? Whatever understanding (if any) I had of threads has melted to nothing. I am struggling with your field of expertise; please help me get back on track. Any assistance embraced.
    ps. don't offer friendly criticism by scolding my design of serialized threads. My only goal is to see if I can do it (and learn something along the way).

  • Waiting the main thread till all child thread has completed

    I am in the process of developing a batch application in Java 5.0 which extensively uses the java.util.concurrency API. Here is a small description of what the batch process will do,
    1. Retrieve values from DB and populate a blocking queue in main thread.
    2. Instantiate a Threadpool by calling, Executors.newFixedThreadPool(2)
    3. Invoking the following block of code from the main thread,
    while(!iBlockingQueue.isEmpty()) {
        AbstractProcessor lProcessor = new  DefaultProcessor((BusinessObject)iBlockingQueue.remove());
        iThreadPool.execute(lProcessor);
    }DefaultProcessor is a class that extends Thread.
    4. Invoking the following block of code from the main thread,
    iThreadPool.shutdown();
    try {
         iThreadPool.awaitTermination(30, TimeUnit.SECONDS);
         } catch (InterruptedException interruptedException) {
              iLogger.debug("Error in await termination...", interruptedException);
    Since, this is the first time I am using the java.util.concurrency API, I want to know whether this is the right way to wait for all the child threads to complete before executing further statements in the main (parent) thread. Or do I necessariliy have to call join() to ensure that the main thread waits for all the child threads to finish which can only happen when the queue is empty.
    Please note here that as per the requirements of the application the blocking queue is filled only once at the very beginning.
    I will appreciate any inputs on this.
    Thanks.

    looks like you would be waiting on a queue twice, once in the loop and again, under the hood, in the threadpool's execute()
    the threadpool's internal queue is all that is needed
    if your iBlockingQueue is also the threadpool's internal queue, you might have a problem when you remove() the BusinessObject
    by making DefaultProcessor extend Thread you are, in effect, implementing your own threadpool without the pooling
    DefaultProcessor need only implement Runnable, it will be wrapped in a thread within the pool and start() called
    to implement a clean shutdown, I suggest writing DefaultProcessor.run() as an infinite loop around the blocking queue poll(timeout) and a stop flag that is checked before going back to poll
    class DefaultProcessor implements Runnable {
      private BlockingQueue myQ;
      private boolean myStopFlag;
      DefaultProcessor( BlockingQueue bq ) { myQ = bq; }
      public void run() {
        BusinessObject bo = null;
        while( !myStopFlag && (bo=myQ.poll( 10, SECONDS )) ) {
          // business code here
      public void stop() { myStopFlag = true; }
    } Now, after iThreadPool.shutdown(), either call stop() on all DefaultProcessors (or alternatively send "poison" messages to the queue), and give yourself enough time to allow processing to finish.

Maybe you are looking for

  • Spot Removal and slow system after a few clicks

    Hello All, I just wanted to bring attention to a very annoying issue. If you use spot removal function a few times in a lightroom session, you end up with the impossibility to use it anymore if you do not exit lightroom and start again from zero. Wha

  • New to XML+Java: which is the best API?

    Hi, I am new to XML+Java and I am trying to develop an application that will both read and write to an XML file. After reading some tutorials, I decided that jaxp, sax, and org.w3c.dom.* are rather low-level and very unfriendly. After a cursory web s

  • After Tiger to Leopard conversion shared user folders stopped working

    Hi, Today i updated our mailserver to leopard. This server is also the OD master. Directly updated to 10.5.1 to have the latest bugfixes. Most things seem to work ok, but somehow our shared folders are not visible anymore. Checked the rights on them

  • Is Flatfile any better than SQL ?

    Hey, I've heard that flatfile databases have a better response than SQL ones. However, I know SQL is much more easy to change and modify. So, is there a good reason to go with flatfile, or just go with SQL, since computers are fast enough nowadays ?

  • IOS 7 Deleted My Apps

    I just downloaded iOS 7 and it deleted my apps. I went to the App Store to download them again but it says that it is already downloaded. How do I get it back to my home screen? Please help!!!!