Thread sends notify() before waiting thread says wait()

In the code below the ref book I'm using "Sun certified Programmer for Java 2" had the calculator thread starting before the Reader thread was even created and hence the calculator thread was finished it's task and sending a notify() before the Reader even had it's socks on and saying wait()
( And this cost me a lot of time tryin to figure this problem out as the code must have being written for a Z80 processor and not a 2.4GHz P4)
To fix this I put the calculator starting after the reader thread, but .......
I would have thought that java would have some protection against this happening, ie, like a notify flag which a thread can set if it has done it's job BEFORE the waiting thread even starts waiting, ie a preemptive mechanism to help speed things up ?
package MyPackage;
public class Reader extends Thread {
Calculator MyCalculator;
public Reader(Calculator calc){
MyCalculator = calc;
public void run(){
synchronized(MyCalculator){
try{
System.out.println("Waiting for calculation ... ");
MyCalculator.wait();
}catch (InterruptedException e){}
System.out.println("Total is: " + MyCalculator.total);
public static void main(String args []){
Calculator calculator = new Calculator();
//calculator.start();
new Reader( calculator ).start();
calculator.start();
package MyPackage;
public class Calculator extends Thread{
int total;
public void run(){
synchronized(this) {
for(int i=0; i<100; i++){
total += i;
System.out.println("Calculation complete, notifying waiting thread..");
notify();

It's up to the 'umble programmer to code it right. The code you quoted was crap.
The most common way to wait is on a condition:
while (hotAndBotherd())
    obj.wait();And then the notifying thread will take steps to change that:
//code that cools off the hot and bothered
obj.notify[all]();If the initial state of things is hot and bothered then there is no race condition: the first thread will wait.

Similar Messages

  • I purchased an iphone 4 yesterday.  I can not send texts.  imessage setting says "waiting for activation. "

    I have received some texts from family who are on the same account and also from spammers but cannot receive from others and cannot send. 

    If you bought it yesterday your service provider (orange, voadfone etc) can take up to a week I believe, depending on who you bought it from, to fully activate your phones features. However being able to receive some texts is odd as this would suggest it has been activated. If you're near the store you bought it from I would suggest going in and just asking about it, or phoning them up if you want, but otherwise you could wait a few days and see if it sorts itself out.

  • Why notify/notifyAll method doesn't resume the waiting thread quickly?????

    I am currently working on a socket based IM server, I get messages from multiple clients simultaneously and put them into queues, for each queue in my server I have a separate listener running in a thread, as soon as a packet comes in the queue (from any client) it��s related thread is notified to get that packet from thread and process it.
    Here I am using wait/notify blocking mechanism to control loop in my listener thread. My logic works like this
    1)     When Listener thread starts it calls the synchronized getNextPacket method on that queue if the queue has any packet (i.e. it��s length is greater then zero) then it will remove that packet from the underlying vector (NOTE: I am using Vector to contain packets) and return that packet to listener thread, else if queue doesn��t have any packet (i.e. its size is zero) then I will call wait() method which causes the listener thread to wait.
    2)     Now when any client adds some packet in that queue using synchronized addPacket( ) method I first add that packet in the underlying vector and then call notify()/notifyAll() to awake that listener thread, which again calls the getNextPacket() method and this cycle continuous like this.
    So multiple threads (clients) are adding data in the queue using synchronized method, only one listener thread is getting data from that queue using a synchronized method again �� .
    This approach works fine but sometimes I have noticed that the listener thread doesn��t resume just after notiy() / notifyAll() has been called , sometimes it resumes after a long time sometimes it even don��t resume (after waiting a long time I assumed this).
    Solutions I tried
    1)     I did set the listener Thread��s priority to Maximum but facing same problem again.
    For better understanding I am also sending you the code for my queue class and it��s listener thread.
    CODE OF QUEUE CLASS
    import java.util.Vector;
    import org.apache.log4j.Logger;
    import com.tcm.unicorn.server.UnicornCustomeObject;
    * @author sajjad.paracha
    public class UIMPCommandsQueue {
         private static final Logger logger=Logger.getLogger(UIMPCommandsQueue.class);
          * Contains all the packets from clients
         private Vector <UnicornCustomeObject> unicornCustomeObjectQueue = new Vector<UnicornCustomeObject>();
         private UIMPCommandsQueue(){
         private static UIMPCommandsQueue uIMPCommandsQueue = null;
         public static UIMPCommandsQueue getInstance(){
              synchronized(UIMPCommandsQueue.class){
                   if(uIMPCommandsQueue!=null){
                        return uIMPCommandsQueue;
                   }else
                        return uIMPCommandsQueue = new UIMPCommandsQueue();
          * Adds a new command
          * @param unicornCustomeObject
         public synchronized void addCommandPakcet(UnicornCustomeObject unicornCustomeObject){
              logger.debug("[[[[[[[[[[[[[[[[[[[[[[[[[[   Going to add a packet in queue  no "+unicornCustomeObject.getClientSession().getRequestQueueNo());
              unicornCustomeObjectQueue.add(unicornCustomeObject);
              //** Notify the Listener (RequestProcessor) Thread that a new packet has been arrived in the queue
              //** So it now can again start it's processing
              notifyAll();
          * Removes an object from queue whose processing has been started or completed
          * @param unicornCustomeObject
          * @return
         private boolean removeCommandPacket(UnicornCustomeObject unicornCustomeObject){
              return unicornCustomeObjectQueue.remove(unicornCustomeObject);
          * <p> If no packet is available in queue it retuns null value
          *     otherwise returns an object from that queue
          * <p>
          * @return unicornCustomeObject
         public synchronized UnicornCustomeObject getNextCommandPacket(){
              if(unicornCustomeObjectQueue.size()>0){
                   UnicornCustomeObject unicornCustomeObject = unicornCustomeObjectQueue.get(0);
                   logger.debug("[[[[[[[[[[[[[[[[[[[[[[[[[[   Got a packet from queue no  "+unicornCustomeObject.getClientSession().getRequestQueueNo());
                   logger.debug("[[[[[[[[[[[[[[[[[[[[[[[[[[   Going to remove a packet from queue no  "+unicornCustomeObject.getClientSession().getRequestQueueNo());
                   removeCommandPacket(unicornCustomeObject);
                   return unicornCustomeObject;
              }else{
                   try {
                        //** Force the Listener (RequestProcessor) Thread to wait for notification
                        //** This Thread will be only notified if a new command packet has been arrived(added) in the
                        //** Queue i.e in addCommandPacket Method
                        wait();
                   } catch (InterruptedException e) {
                        logger.error("",e);
                   return null;
    CODE OF LISTENER CLASS
    import org.apache.log4j.Logger;
    import com.tcm.unicorn.server.UnicornCustomeObject;
    public class RequestProcessor implements Runnable {
          * will listen on Request queue for any new massages
         public void run() {
                   //** get an instance of RequestQueue before the loop  
                   UIMPCommandsQueue requestQueue= UIMPCommandsQueue.getInstance();
                   while(true){
                        try{
                             //**call the blocking method getNextCommandPacket()     
                             UnicornCustomeObject unicornCustomeObject= requestQueue.getNextCommandPacket();
                             if(unicornCustomeObject!=null){
                                  System.out.println("Got a pcket will process it now.......");                    
                        }catch(Exception exp){
                             exp.printStackTrace();
    Can anybody please tell me where I am doing something wrong and whats the best way to get rid of this situation .
    Thanks in advance
    Message was edited by:
    meetsaju

    Another question !
    in my previous programe i have seen a starange behavior , my processor thread sometimes processes the later message before the message came before that in queue here is an output of my debug statements
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 10
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 11
    INFO :03 May 2007 11:21:17,>>>>>>>>>>>>>>>>>>>>>>>>requestProcessorThread is in block state
    INFO :03 May 2007 11:21:17,>>>>>>>>>>>>>>>>>>>>>>>>requestProcessorThread is in block state
    INFO :03 May 2007 11:21:17,>>>>>>>>>>>>>>>>>>>>>>>>requestProcessorThread is in block state
    INFO :03 May 2007 11:21:17,>>>>>>>>>>>>>>>>>>>>>>>>requestProcessorThread is in block state
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 30
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 13
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 0
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 12
    INFO :03 May 2007 11:21:17,>>>>>>>>>>>>>>>>>>>>>>>>requestProcessorThread is in block state
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 20
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 40
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 31
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 14
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 15
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 32
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 33
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 16
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 34
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 17
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 35
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 18
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 36
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 19
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 37
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 41
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 38
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 39
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 42
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 43
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 21
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 44
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 22
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 45
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 23
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 46
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 24
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 47
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 25
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 26
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 49
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 48
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 27
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 28
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 1
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 2 look at the lines
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 49
    INFO :03 May 2007 11:21:17,[[[[[[[[[[[[[[[[[[[[[[[process the packet no 48
    as for as i know it shouldnt be the case as we are using a FIFO queue here....just querious how it is possible that a later message is taken from a FIFO queue.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • My wait() thread never wakes up with notify()

    In the code below, I'm trying to wake up the DispatchThread whenever the add method is called in the PriorityQueue. For some reason the notify() method is not unblocking the thread. All I can figure is that the reference to the thread in notify() is incorrect. Can anyone find the problem with the code?
    import java.util.TreeSet;
    public class PriorityQueue{
      private TreeSet queue;
      private DispatchThread d_Thread;
      private Thread d_thread;
      //default constructor
         PriorityQueue()
           queue = new TreeSet();
         d_Thread = new DispatchThread(this);
         public  void add(Object anobject)
        synchronized (this.d_Thread)
            queue.add(anobject);
          this.d_Thread.notify();
          System.out.println(anobject+" added to queue now");
          try
            Thread.sleep(500);
          catch (InterruptedException e){}
         static void main(String args[])
              PriorityQueue intTest = new PriorityQueue();
              intTest.add(new Integer(25));
              intTest.add(new Integer(35));
              intTest.add(new Integer(6));
    class DispatchThread implements Runnable{
      private PriorityQueue queue;
      private Thread d_Thread;
      public DispatchThread(PriorityQueue queue)
        this.queue = queue;
        d_Thread = new Thread(this);
        d_Thread.start();
      public void run()
        while(true)
          synchronized (this.d_Thread)
            try
              System.out.println("about to wait - dispatch thread");
              this.d_Thread.wait();
              System.out.println("just woke up dispatch thread"); //never makes it this far
    //do some dispatching operations here
            catch(InterruptedException ie){}
    }

    When you call the wait method, you use the thread you create in the constructor of DispatchThread.
    When you call the notify method, you use another lock, the Dispatch object itself.
    And notify and wait are methods defined in Object. It's rarely you would use a thread object as a lock.
    You can make you code work if you do this in DispatchThread:
    synchronized (this) {
      try {
        System.out.println("about to wait - dispatch thread");
        wait();
    }because now you use the same lock both places.

  • Invoking "this.notify()" before thread exit?

    a Runnable class that i am writing must account for 2 cases:
    (1) the user wants to do other work while the Runnable does its business.
    (2) the user wants to wait for the Runnable to exit before continuing on with other work.
    this is my best solution:
    MyRunnable mr = new MyRunnable();
    new Thread(mr).start();
    synchronized(mr) {
      mr.wait();
    public class MyRunnable implements Runnable {
      public void run() {
        synchronized(this) {
          this.notifyAll(); // just before exit, i notify everyone that i am exiting. but if no one is waiting, what harm does this do?
    } further, why not do this.notifyAll() for all Threads / Runnables just before they exit?
    if no one is waiting, is there harm in invoking notifyAll() ? seems that this just adds a new feature to my class at no cost??
    my understanding of OOP is that a class writer should not assume how a user will use his class, so this seems like a good option. yet, this does seem non-standard.
    Edited by: kogose on Oct 19, 2008 11:53 AM

    But why start a thread at all only to wait for it? In the case where the caller wants to wait, he should just call your run() method directly. No other code required. In the case where he wants to proceed independently, he can call new Thread(xxx).start().

  • Pretty sure that i am blowing past the notify() before the wait()

    i am working on a project, and here is my basecase.
    public class Worker extends Thread {
      public boolean taskFinished = false;
      private Object flag = new Object();
      private FutureTask task;
      public void run() {
        while(true) {
          synchronized(flag) {
            flag.wait();
            taskFinished = false;
            task.run();
            taskFinished = true;
      public void execute(FutureTask task) {
        synchronized(flag) {
          this.task = task;
          flag.notify();
    }here is an example of how i'd use this class:
    FutureTask ft = new FutureTask(task);
    Worker worker = new Worker();
    worker.start();
    // Thread.sleep(10);  <-- this "fixes" the problem (well, makes the problem much less probable)
    worker.execute(ft);
    ......without the wait(10) , the program works about 80% of the time.
    with the wait(10) , my testing has always completed successfully. but that does not really solve the problem.
    i am almost certain that i am calling flag.notify() before the flag.wait() ..... i have no idea of what to do.
    note: this is probably a "non-standard" way to use FutureTask , and its more appropriate to use an ExecutorService to take care of this
    business, but my problem is larger than this base case. i want to use this general structure. otherwise, i need to re-design.

    When I visit at http://ezinearticles.com/?Acai-Berry---How-I-Lost-30-Pounds-in-Under-30-Days-Using-The-Acai-Berry&id=1998407 I found a product of acai berry to reduce weight. That one I try and find myself in good shape and I am happy to share this with all about acai berry.Acai Berry Weight Loss Program free!

  • Best way for a thread to wait without busy-waiting

    Hi!
    I have a thread that has nothing to do but to monitor the status of a variable
    public static boolean askToClose. This variable is set by other
    threads to indicate that this thread should stop now. But I don't want the thread
    to busy-wait like in this piece of code :
    public void run() {
         while (!askToClose) {
              Thread.sleep(1000);
         cleanAndStop();     
    }I'm new to Thread programming in Java so I'm not sure what's the best way to wait
    for an event without busy-waiting. I've tried using interruption instead of
    monitoring for the boolean variable :
    public void run() {
         try {
              synchronized (this) {
                   System.out.println("WAITING");
                   wait(0);
         catch (InterruptedException e) {
              System.out.println("INTERRUPTED !");
         cleanAndStop();     
    }and the other threads would simply call myThread.interrupt() instead of setting
    askToClose = true;And I've also used a LinkedBlockingQueue :
    public static LinkedBlockingQueue q = new LinkedBlockingQueue();
    public void run() {
         try {
              q.take();//Waiting
         catch (InterruptedException e) {}
         cleanAndStop();     
    }and on the other threads :
    MyThread.q.add(new Object());Which one is the best solution ? Do I really avoid busy waiting with this code? Is
    there a better way of doing this?
    Thx for your help !

    Your wait() based solution is OK, except that the other thread should
    use
    synchronized()
      notify();
    }

  • Java.lang.IllegalStateException: Exceeded maximum number of waiting threads

    Hi all,
    I use coherence3.3.1,coherence work as hibernate L2 cache and meet following problem,could you help me check the problem?thanks.
    java.lang.IllegalStateException: Exceeded maximum number of waiting threads (Status=2)
         at com.tangosol.net.cache.OverflowMap$Status.waitForAvailable(OverflowMap.java:4029)
         at com.tangosol.net.cache.OverflowMap.prepareStatus(OverflowMap.java:2152)
         at com.tangosol.net.cache.OverflowMap.beginKeyProcess(OverflowMap.java:1873)
         at com.tangosol.net.cache.OverflowMap.getInternal(OverflowMap.java:580)
         at com.tangosol.net.cache.OverflowMap.get(OverflowMap.java:330)
         at com.tangosol.coherence.component.util.CacheHandler.getLease(CacheHandler.CDB:3)
         at com.tangosol.coherence.component.util.CacheHandler.getCachedResource(CacheHandler.CDB:10)
         at com.tangosol.coherence.component.util.CacheHandler.get(CacheHandler.CDB:1)
         at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB:1)
         at com.tangosol.coherence.hibernate.CoherenceCache.get(CoherenceCache.java:65)
         at org.hibernate.cache.StandardQueryCache.get(StandardQueryCache.java:105)
         at org.hibernate.loader.Loader.getResultFromQueryCache(Loader.java:2152)
         at org.hibernate.loader.Loader.listUsingQueryCache(Loader.java:2117)
         at org.hibernate.loader.Loader.list(Loader.java:2087)
         at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:289)
         at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1695)
         at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:142)
         at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:150)
         at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:804)
    j

    Hi,
    Can you please provide the relevant coherence config files?
    thanks,
    -Rob

  • When sending document to printer it now says waiting

    when sending photos or document to my printer, i now get a message in my print center that says waiting. I have been able to print

    What you see at the top of the iTunes window is usually the name of the folder where your "iTunes Library.itl" file resides (that is your main library file). By default that folder name is "iTunes" and that's why you'd see it displayed, not because that is the name of the program.
    But now with "Library.xml" showing I wonder if you re-built your library by opening your .xml file? Just for kicks, you might hold the Shift key as you launch iTunes and select "Choose Library" at the prompt, then navigate to where your "iTunes Library.itl" file resides and see what comes up.

  • Why thread#2 wait thread#1 txn- commit(0)

    void sleepwrite(Db* pdb,int id,int v,const char* title)
         int starttm=GetTickCount();
         char buf[256];
         sprintf_s(buf,256,"%s%i\n",title,id);
         print(buf);
         sprintf_s(buf,256,"%s%i","SleepWrite",id);
         Dbt key,data;
         key.set_data((void*)buf);
         key.set_size((strlen(buf)+1)*sizeof(char));
         data.set_data((void*)&v);
         data.set_size(sizeof(int));
         DbEnv* env=pdb->get_env();
         DbTxn* txn;
         env->txn_begin(NULL,&txn,0);
         pdb->put(txn,&key,&data,0);
         if (id==0)
              Sleep(2000);
         txn->commit(0);
         sprintf_s(buf,256,"%s%s%i tm:%d\n",title,"end",id,GetTickCount()-starttm);
         print(buf);
    int main()
         MyDbEnv     myenv("/DataStore/Env","mydb.db");
         MyDb mydb(myenv); //db_flag=DB_CREATE | DB_AUTO_COMMIT;
         boost::thread_group g;
         for (int i=0;i<2;++i)
              g.create_thread(boost::bind(&sleepwrite,&mydb,i,10,"sleepwrite"));
         g.join_all();
         countRecords(&mydb,NULL);
    output:
    sleepwrite0
    sleepwrite1
    sleepwriteend0 tm:2000
    sleepwriteend1 tm:2000
    countRecords*******************
    key:SleepWrite0 data:10
    key:SleepWrite1 data:10
    countRecords*******************
    why thread#2 wait thread#1 txn->commit(0)?there are two work thread,every thread have one txn
    Modify
    pdb->put(txn,&key,&data,0);
    to
    pdb->put(0,&key,&data,0);
    output:
    sleepwrite0
    sleepwrite1
    sleepwriteend1 tm:0
    sleepwriteend0 tm:2000
    countRecords*******************
    key:SleepWrite0 data:10
    key:SleepWrite1 data:10
    countRecords*******************
    the result is expect,but what is the different?

    When I upgrade the system to OAS 10.1.3.0.0. I still got same error message. Any suggestion will be appreciate.

  • HT5312 Can't get iMessage to work on my iMac . i put my iPhone # in is says waiting to verify. who is verifying this send that email was sent but to who.

    Can't get my Imessage to work on my imac . I put my iphone # in and it said verifyiing then said email sent,but i never received an email now it says waiting to verify but by who.

    Download the demo and activate with your serial number:
    http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html
    Be sure to follow the special instructions.
    You will also probably need to run the un-installer first to clean up the old files.

  • Apps say "waiting" when i restored phone twice?! Help!?

    Ya so i have restored my phone twice because the album art on some albums were wrong so i read that you could restore it so i restored it and none of my apps loaded back. So i restored it again thinking that i would work, but everysingle time the apps just say waiting. I can open my apps thru the app store but i can't open them from my home screens. I have tried apple support and everything, but nothing has helped. I was also going to restore it via itunes, but some of my songs would be permentley deleted. Help I have no idea what to do!!!

    http://lifehacker.com/5948155/fix-iphone-apps-stuck-waiting-during-installation
    http://osxdaily.com/2012/03/17/fix-ios-apps-stuck-on-waiting/
    https://discussions.apple.com/thread/4254406?tstart=0
    https://discussions.apple.com/thread/4074945?tstart=0

  • Bought an app (Photo Transfer) that continues to say waiting and not open

    Bought a Photo Transfer app that continues to say waiting and will not open.  What can I do?

    Hello,
    This usually happens if there is another download in progress, like another app is updating or downloading. If there are no other apps downloading or updating then you may want to restart your device to try to resume the download of the app that way. I've seen this happen before and the download started after the restart of the device.
    If you have a problem with the app itself then don't hesitate to send an email to our support inbox: support [at] phototransfera [dot] com.
    Cheers,
    Enrique
    (From "Photo Transfer App")

  • I have just updated my iphone 4s to ios7 and when i download an app it says 'Waiting' on the icon then disappears.

    I have been having problems downloading apps for a while now. I only just downloaded IOS 7 but I thought it would help me, it hasn't.
    I go onto the app store to download and app, i enter the correct passwrd and the apps icon appears to be downloaded. The waiting sign appears on the icon and then the icon itself disappears, then on the app store it looks as though i have never tried to download it! PLEASE help! i didnt get Flappy Bird because of this issue! lol

    Hi Nerdyninja12,
    Thanks for visiting Apple Support Communities.
    Try this step first if an app download on your iPad is not completing:
    Try tapping the App, so that it changes to Paused instead of Waiting, then tap it again to resume the install.
    Make sure you don't have any paused downloads in other apps either, like the App Store or iTunes Store.
         App updates won't download on my iPhone, they just say waiting.
         https://discussions.apple.com/thread/4111336
    If the download still does not complete, force close and re-open the App Store. Here's how to force close an iOS application:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app's preview up to close it.
    These steps come from this article:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    All the best,
    Jeremy

  • HT2404 When downloading an app it's not downloading it's just saying waiting ?? can someone help pls

    help pls

    Hi keironhadley,
    If you are having issues with an app download stuck at Waiting, you may find the following discussion thread helpful:
    Apple Support Communities: App updates won't download on my iPhone, they just say waiting
    https://discussions.apple.com/thread/4111336
    Regards,
    - Brenden

Maybe you are looking for

  • Payments transactions in t-code FK02

    Hi, I would like to allow only one user to change the payment transactions in provider master data but i want to allow all the other users to change data like the address and the name Ca i achieve my goal? How can i do that?                          

  • MBA (mid 2013) - FacetimeHD camera

    Hi, I have same strange issues with my MBA (mid 2013) and the FactimeHD camera (MacOS 10.10.1) The camera is working with PhotoBooth, Facetime and Skyoe (newest version), but with WebeX and MS-Silverlight the camera is not recognized. Is thus a know

  • Problem during Transaction in update

    I am using a Bussiness method UPDATE in which i am first deleting the record and then i am creating  agian the same record with the new values. While performing create operation if any of the values  passed are wrong, then create process fails. and t

  • Any idea when GTX 970's will be added to the supported list in the latest version of premiere? id like my cuda.

    Any idea when GTX 970's will be added to the supported list in the latest version of premiere? id like my cuda.

  • AS3 sucks !!! Why can't access a simple movieClip ???

    Hi People, Please - it's as simple as that: I have a stageand there is a movieClip instance called "obiekt" in it. Inside "obiekt" movieClip there are two other clips. One instance is called "z1" and another one is called "z2". Presume I have a event