Update jLabel in between Thread.sleep()'s

I have multiple Thread.sleep()'s in my code under a jButton actionevent evt.
In between these, I need to be able to update a jLabel, but for some reason it waits until the last thread.sleep() before it updates the jLabel.
Any ideas why?
private void jButtonActionPerformed(java.awt.event.ActionEvent evt) {
   try {
      Thread.sleep(1000);
      jLabel.setText("Change Text To This");
      Thread.sleep(1000);
   } catch (InterruptedException ex) {}
}So rather than waiting 1000ms, then update label, then wait another 1000ms, it just waits 2000ms, then updates the label
Please help!
Thanks

Edward9 wrote:
I am new to Java and I just cannot work out the tutorials,Hard luck then.
the code behind my applet doesn't matter as long as it works,Which it will, of you code it correctly after learning from the tutorials.
I have spend 6 months on this appletWould have taken much less time to learn to do it correctly.
and everything worksBy your definition of "works"
apart from this one problem --> jLabel to update between thread.sleep()'s.Easy when you know how.
Its all I need to do and my project will be over and I can get away from Java.I have a suggestion: why don't you get away from Java right now, take the failing grade you've earned, and get on with your life. Really.
Is there absolutely no way it can be done?Already covered above and in previous responses.
I was told the jLabel will not update until the thread is free to do so, so i will need to look up on multiple threads,No, you need to go through the Swing tutorials.
i have tried to but none of it makes sense to what i need done.Give up. Now.
db

Similar Messages

  • Updating frame content between Thread.sleep() calls

    I have several JLabels in a Frame. What I want is to update the content of the labels (to be more precise, the ImageIcons), but with pauses in between each update (lets say 1 second). So, I want to change the content of one label, have those changes show on screen, then, wait for a second and change the content of the second label, show the changes, wait for a second, change the next label, and so on...
    What I'm doing is:
    change label 1
    Thread.sleep(1000);
    change label 2
    Thread.sleep(1000);
    change label 3
    Thread.sleep(1000);
    ...And the problem is that the individual changes are not shown on screen until the whole process has finished. It does pause after each change, but the change to the particular label is not shown afterwards. Then, when the whole process is finished, the changes to all the labels are shown simultaneously on screen.
    I have tried calling repaint() and validate() after each call to Thread.sleep(), but it makes no difference.
    Why are the changes not updated on screen until the end?
    How can I achieve what I'm trying to do?
    Many thanks in advance.

    You're sleeping in the main thread, so you're holding up the paint thread too...
    I'd trying extending each label / visual component, to include it's own timer and thread.
    eg. ( not compiled nor tested, but addresses all the main points... )
    regards,
    Owen
    public class myLabel extends JLabel implements runnable
        boolean animate = true;
        Thread paintThread;
         public myLabel ( )
              super();
              paintThread = new Thread ( this );
         public void startAnimation ( )
              if ( animate == false )
                 animate = true;
                 paintThread.start();
         pubic void stopAnimation ( )
             animate = false;
         public void run ( )
               while ( !animate )
                   Thread.sleep ( 1000 );
                    final Runnable runnable = new Runnable()
                        public void run()
                              // change label text
                              // Make any Swing / GUI changes here                      
                        } // run
                   };    // runnable
                   // force/flag this label as requiring a repaint
                   invalidate();              
                   // NB : You must use this to avoid multi-threaded problems with Swing
                   SwingUtilities.invokeLater(runnable);
    }

  • Difference between thread.sleep and BufferedReader.readline()

    Hi All,
    I have J2SE application which is infact a listener, to keep it working for 24/7 what you people suggest do i use
    while(true)
    Thread.sleep(10000);
    or
    BufferedReader br = new BufferedReader( new InputStreamReader(System.in));
    System.out.print("Enter Quit to Exit.. ");
    String cmd = br.readLine().trim();
    if (cmd.equalsIgnoreCase("quit"))
    System.out.println("Quitting...");
    System.exit(0);
    Please also suggest which one is optimized solution.
    Regards,
    raza

    emmi@java wrote:
    HI,
    My application is J2SE based not web based.
    RegardsSorry, could have sworn I read J2EE.
    In any case, a thread is exactly what you want. And neither "sleep" nor "readline" but a simple wait().
    Edit: And, yes, the real question is, as already asked, what do you mean by "listener"?

  • Difference between LockSupport.parkUntil and Thread.sleep method

    Hi
    Could someone please explain the difference between LockSupport.parkUntil and Thread.sleep methods.
    Thanks in advance.

    javaLearner wrote:
    The thing that I am trying to understand is - the difference / correlation between the two methods mentioned.
    In the javadoc, there is a mention of correlation between the LockSupport methods park, unpark and the Thread methods suspend, resume - but not park and sleep.Then that suggests that there isn't any difference /correlation -- whatever you meant by that. Perhaps your question is like asking for the difference between a fish and a bicycle.
    Also, I would like to understand the statement
    These methods are designed to be used as tools for creating higher-level synchronization utilities, and are not in themselves useful for most concurrency control applications. (from the javadoc)Again, you're going to have to explain what you don't understand about it.

  • What's wrong to put Thread.sleep in a session bean?

    i am working on a trading platform and i think there is a design flaw. The part i am working on is the Order Management module. When an order value object is published to a JMS topic and picked up by a MDB. The MDB, in turn, calls a session bean (could be stateless, I didn't check), OrderEngineBean. After this bean saves the order vo into database and broadcast the message to all involved parties, it suspends for 12 sec, using Thread.sleep, so other parities might have a chance to update the vo. If no update occurs, the order is considered expired and abandoned.
    It looks awkward to me to use a Thread.sleep in a session, but I haven't come out with a better idea to deal with the scenario like above.
    Anyone can help me out?
    Thanks a lot!
    Sway

    Setting the property "max-beans-in-free-pool" is not the answer to this issue. By setting this property to 1, the container merely instantiates and keeps one instance of the bean in the free pool at the "start" of the app server. But if the container comes across more than one requests for the same EJB simultaneoulsy, then it will create new instances at that time to handle the requests simultaneously.
    You are seeing intermixed log messages between two threads because these messages are being logged from two different instances of the EJB and NOT the same instance of the EJB. The container does synchronizes the calls on "a method" on "a instance". So what you are seeing are the messages coming from "a method" on "two different instances" of the same EJB.
    You can refer to the EJB 2.0 specification section 6.11.6 Non-reentrant instances for details about simultaneous access to the same session object.

  • One thread adding/updating value  and other thread getting values....issue

    am using a spring bean (singleton) and this is how it looks like
    public class MySingletonService {
    private Map<String, List<TaskVO>> alerts = new HashMap<String, List<TaskVO>>();
    //spring will call this method every 15 minutes
    public void pollDatabase() {
    //initialize the alerts instance variable and create/fill the alerts instance variable with new alerts for the employee(from database) .The key for the hashmap is the employee id
    //some client code (e.g. GUI) will call this method to get the alert for the operator id.This can be called anytime to get the latest info from the alert Map
    public List<TaskAlertVO> getOutstandingAlerts(String operatorId) {
    return alerts.get(operatorId);
    The issue here is that when getOutstandingAlerts is invoked by a thread,some other thread(Spring) calling the pollDatabase method might be updating the value.Please give me some idea and solution to get around this issue.
    I was thinking of creating a copy of alerts instance variable in the getOutstandingAlerts method and then use the copy to find the key and return the alert for that operator id.This way we dont have to worry about data conflict.
    Please advice

    Manjit wrote:
    jtahlborn wrote:
    if the pollDatabase() method is getting a complete new copy of the alerts every time, and the alerts map isn't being modified at all after load, then you can just:
    - make the alerts member variable volatible
    - create a new HashMap each time pollDatabase() is called, fill it in, and then assign it to the alerts member variable. Jtalhorn,I think I got your point.Basically you are suggesting that by creating a brand new map in each pollDatabase operation, then I dont have to worry about get operation ,simply because the client code is still looking at old memory location(old copy) and hence should not worry about values getting changes by pollDatabase method.
    I got it.
    But the small doubt is that why even I should bother about making the instance variable volatile ? Your suggestion should work without making it volatilebecause volatile ensures correct memory visibility between threads. if you didn't use volatile, then a caller to getOutstandingAlerts() could see some partially initialized/corrupt version of the map.

  • "Portable" way to do message passing between threads?

    (I posted this on the Apple Developer Forums already, but since that forum is only accessible to registered and paid iPhone developers, I thought it would be nice to put it here as well so as to get some more potential eyeballs on it. I apologize if this kind of "cross-posting" is not kosher/is frowned upon around here.)
    Hey everybody,
    "Long-time listener, first-time caller," heh.
    I've been working for the past 2-3 months on my very first iPhone app. Actually, what I've been working on is a framework that I plan to use in an iPhone app of my own but which I am also trying to write for the "lowest-common-denominator" so that I (and others) can use it in other apps written for both Mac and iPhone.
    Not only is this my first time writing an iPhone app, it is my first time writing for any Apple platform. In fact, it is my first time using Objective-C, period. I cannot stress this enough: I am a "n00b." So go easy on me. I also have not worked with threading before this, either, on any platform, so the learning curve for me here is rather significant, I'm afraid. I am NOT afraid of either taking the time to learn something properly OR of rolling up my shirtsleeves and working. However, on account of my experiences so far, I am finding myself (not to flame or anything!) quickly becoming frustrated by and disillusioned with not so much Objective-C itself, but the Foundation frameworks.
    So with that said, read on, if you dare...
    The basic idea behind my project is that the framework I am writing will present an API to developers which will allow them to write client apps that interact with a particular network appliance or network-aware embedded system. I already have my basic set of classes up and functioning, and the framework works to my satisfaction both on MacOS and iPhoneOS. The platforms I am targeting are MacOS X Tiger 10.4 and later, and iPhoneOS, and up until this point, I've managed to keep a codebase that works on all of the above.
    What I wanted to do next was add some multithreaded goodness to the mix. (Woe is me.) I have asynchronous network socket I/O working within the main thread, and it, in fact, works a treat. In my test app on the phone, I've managed to keep the UI nice and responsive by using the main thread's runloop efficiently. But even though TCP async I/O works fine within the main thread, I want to be able to split out and offload the processing of any data received by the app from the appliance to its own thread. (It is possible, and even desirable, for an application using this framework to be connected to multiple appliances simultaneously.)
    My idea, in order to try to keep things as simple and as clean as possible, was to implement a wrapper class that presented my other main class as an "actor." So, rather than instantiating my main class, one would create an instance of the wrapper class which would in turn control a single instance of my main class and spawn its own thread that the network connection and all data processing for that particular connection would run within.
    (I hope I'm making sense so far...)
    Out of the gate, writing a subclass of NSThread sounds like the logical design choice for an "actor-type" thread, but because I was trying to maintain Tiger compatibility, I stuck with +detachNewThreadSelector:etc.
    Once I decided to pursue the actor model, though, the main problem presented itself: how to best pass messages between the main thread and all of the "actor" threads that might be spawned?
    I stumbled upon -performSelector:onThread:withObject:, and knew instantly that this was exactly what I was looking for. Unfortunately, it doesn't exist on Tiger; only its much more limited little brother -performSelectorOnMainThread:withObject: does. So I kept looking.
    All of the pre-Leopard documentation, tutorials, and sample code that I read indicated that to pass messages between threads, I needed to basically pretend that the threads were separate processes and use the expensive Distributed Objects mechanism to get messages back and forth. Unfortunately, even if that WAS a desirable option, iPhoneOS does not have any support for DO! Grrr...
    Finally, I thought I found the answer when I ran into a third-party solution: the InterThreadMessaging library from Toby Paterson (available @ http://homepage.mac.com/djv/FileSharing3.html). In this library, the author basically implemented his own version of -performSelector:onThread:withObject: called -performSelector:withObject:inThread:. Sounds close enough, right? And actually, it is pretty darn close. It's made to do exactly what it sounds like, and it does it in a platform-neutral way that works on pre-Leopard systems as well as iPhoneOS, using Mach ports instead of DO.
    (...wellll, ALMOST. I discovered after I built a small test app around it that it actually isn't "iPhone-clean." The author used an NSMapTable struct and the NSMap*() functions, which don't exist in iPhoneOS, and he also implemented the handlePortMessage delegate method, but although iPhoneOS has NSPort, it DOESN'T have NSPortMessage. GAAARGH. So I took the time to replace the NSMapTable stuff with NSValue-wrapped objects inside of an NSMutableDictionary, and replaced the handlePortMessage method implementation with a handleMachMessage method, which took some doing because I had to figure out the structure of a Mach message, NO thanks to ANY of the available documentation...)
    Once I started using it, though, I quickly discovered that this implementation wasn't up to snuff. My "actor" class and my main thread will be passing a ton of messages to each other constantly whenever there is network activity, and with InterThreadMessaging, I found that whenever activity started to ramp up, it would collapse on itself. This mostly took the form of deadlocks. I found a note that someone else wrote after experiencing something similar with this library (quoted from DustinVoss @ http://www.cocoadev.com/index.pl?InterThreadMessaging):
    "It is possible to deadlock this library if thread A posts a notification on thread B, and the notification on B causes a selector or notification to be posted on thread A. Possibly under other circumstances. I have resolved this in my own code by creating an inter-thread communication lock. When a thread wants to communicate, it tries the lock to see if another thread is already using the InterThreadMessaging library, and if it can't get the lock, it posts a message to its own run-loop to try again later. This is not a good solution, but it seems to work well enough."
    So I tried implementing what he described using a global NSLock, and it did help with some of the deadlocks. But not all. I believe the culprit here is the Mach ports system itself (from the NSPortMessage documentation for -sendBeforeDate:):
    "If the message cannot be sent immediately, the sending thread blocks until either the message is sent or aDate is reached. Sent messages are queued to minimize blocking, but failure can occur if multiple messages are sent to a port faster than the portís owner can receive them, causing the queue to fill up."
    InterThreadMessaging in fact calls -sendBeforeDate: and exposes the deadline option, so I tried setting a really short time-to-live on the Mach messages and then intercepted any NSPortTimeoutExceptions that were thrown; upon catching said exceptions, I would then re-queue up the message to be sent again. It worked, but Performance. Was. A. Dog. At least the message queue wouldn't be full indefinitely anymore, causing the main thread to block, but during the whole time that these messages were expiring because the queue was full and then being re-queued, either the main thread was trying to send more messages or the actor thread was trying to send more messages. And as far as I can tell, the Mach ports queue is global (at the very least, there is seemingly only one per process). The message would get through with this model...eventually.
    JUST IN CASE the problem happened to be something I screwed up as I was rewriting portions of the InterThreadMessaging library so that it would compile and work on the iPhone SDK, I substituted in the original version of the library in my Mac test app to see if any of these problems became non-issues. I found that both versions of the library -- mine and the original -- performed identically. So that wasn't it.
    Finally, in frustration I said, "screw it, I'm going to try it the Leopard way," and replaced all of the method calls I was making to InterThreadMessaging's -performSelector:withObject:inThread: with calls to Foundation's native -performSelector:onThread:withObject: instead, changing nothing else within my code in the process. And wouldn't you know: IT WORKED GREAT. Performance was (and is) fantastic, about on-par with the non-threaded version when only dealing with a single connection/instance of my class.
    So, in the end, I was able to do nothing to salvage the InterThreadMessaging implementation of cross-thread method calling, and as far as I can tell, I'm out of (good) options. And thus my mind is filled with questions:
    How is the Leopard -performSelector:onThread: method implemented? I'm guessing not using Mach ports, given that I didn't have the same blocking & deadlocking problems I had with InterThreadMessaging. Is it possible to re-implement this Leopard+ method in a similar manner as a category to NSObject under Tiger? Or is it possible, perhaps, to increase the size of the Mach ports queue so that InterThreadMessaging works at a sane level of performance? Or -- I'm getting desperate here -- is there any way that I could trick -performSelectorOnMainThread: to target a different thread instead? (I am assuming here that -performSelectorOnMainThread is implemented under-the-hood much like the new -performSelector:onThread: is implemented, but with a hard-coded NSThread pointer built-in to the code, and that the new method just exposes a more flexible interface to what is basically the same code. I'm probably wrong...) Is there another third-party library out there that I've missed that fits my requirements for being able to do message-passing between threads in an efficient and portable manner?
    I refuse to believe that there is no way for me to maintain compatibility with all of the platforms I wish to support without having to resort to making preprocessor #ifdef spaghetti out of my code. And there SURELY has to be a better way of doing cross-thread message passing in Tiger without using Distributed Objects, for Pete's sake! Is this really how people did it for years-on-end since the dawn of NeXT up until the advent of Leopard? And if there really, genuinely wasn't another alternative, then what is up with the lack of DO in iPhoneOS?? Does Apple seriously intend for developers who have good, solid, tested and working code to just chuck it all and start over? What if there was some aspect of DO that previous implementations relied upon that cannot be recreated with simple -performSelector:onThread: calls? (I don't know what those aspects would be...just a hypothetical.) I mean, I can understand needing to write new stuff from scratch for your UI given how radically different the interface is between the Mac and iPhone, but having to reimplement back-end guts such as something as elemental as threads...really?!
    I do laud the inclusion of the new method in Leopard as well as the new ability to subclass NSThread itself. But for those of us that need to support Tiger for one reason or another, some of these restrictions and omissions within iPhoneOS seem like rather pointless (and frustrating) roadblocks.
    As I hope is obvious here, I have tried to do my homework before throwing up my hands and pestering y'all. If you have the patience to deal with me, please tell me what I am missing.
    Thanks for taking the time to read,
    -- Nathan

    Thanks again for your patience. Comments below.
    etresoft wrote:
    It is pretty unusual that anyone would want to call perfomrSelector on any thread other than the main thread.
    What I described in my original post was not a worker thread, but an "actor."
    It is hard for me to answer this question because there are so many options available to do "message passing". The fact that you think there are so few tells me that you really aren't sure what you need to use.
    I didn't say there were few options for message passing. I said there were few options for message passing that fit my criteria, which are that any potential solutions should both A) work efficiently and with good performance, and B) be available both pre-Leopard AND on the iPhone. -performSelector: ain't available before Leopard. Distributed Objects is overkill. Kernel Mach messages apparently have a high overhead, too, as my experience with the third-party library I wrote about in my original message shows.
    ...consider notifications.
    I thought notifications couldn't be posted across threads, either. How do I post a notification to another thread's default notification center or notification queue from a different thread?
    The notification center is owned by the process. Each run loop can listen for just the notifications it wants. You don't "pass" or "send" notifications, you run then up the flagpole for all to see.
    I am aware of how to use notifications. The documentation for NSNotificationCenter clearly states that "In a multithreaded application, notifications are always delivered in the thread in which the notification was posted, which may not be the same thread in which an observer registered itself."
    So, again, I don't see how one thread can post a notification in such a way that the observer's registered method is executed in another thread (posting notifications "across threads"). This probably isn't a big deal if you are using mutexes (assuming you don't actually care which thread carries out the task associated with the notification posting), but as I said before, this is not what I'm after.
    I don't know what you are really after.
    Allow me to attempt to explain a second time, in a more concise fashion.
    My app will have multiple, persistent TCP connections open, one connection per remote device. The user will be able to select a task to execute on a particular device that we have a connection open to, and get back from the application real-time updates as to the progress or results of the execution of that task. In certain cases, the length of the task is infinite; it will keep executing forever and sending back results to my application which will update its display of the results every second that ticks by until the user STOPS that particular task.
    This can be done simply using async I/O in the main runloop, sure. But if I were going to thread this so that I could be processing the results I've received back from one *or more* remote devices while also doing something else, given that I will only have one (persistent) connection open to any given remote device that I'm interacting with (that is to say, I won't be opening up a separate TCP session for every single task I want to execute on a single device simultaneously), it makes sense _to me_ to implement this as I've described: with every connection to each remote device getting its own thread that lasts for the lifetime of the TCP session (which could be the entire time the application is running, times however many devices the user wishes to be connected to while in the app). I won't be spawning a new thread for every task the user wishes to ask a remote device to do.
    This is why (I think) I need bi-directional messaging between the main thread and each of these threads dedicated to a given remote device that we have an active session with/connection to. The main thread needs to be able to tell remote device X (which already has a running thread dedicated to it) to do task A, and then get real-time feedback from that remote device so that the main thread can be displaying it to the user as it is coming back. Same with remote device Y running task B, simultaneously. At any time during the execution of these tasks, the user needs to be able to tell my app to stop one of these tasks, and the main thread needs to send that message to one of the remote devices via that device's dedicated thread.
    This is why I am talking about this in terms of the "actor model," and not the "worker thread model," because the former model seems to fit what I want to do.
    -- Nathan

  • Mouse events during Thread.sleep

    hi.
    I have an applet .
    I have a alghoritm simulator.
    Everytime I find a solution I call the method Thread.sleep .
    I want to pause the application and I create a JToggleButton Pause .
    When I press the Pause during sleep mouse event are managed at the end of alghoritm.
    How can I manage mouse events during sleep?

    All UI events (such as mouse events) occur on the event dispatch thread (EDT).
    That means if you sleep on the EDT, you lock up the UI. For this reason, you shouldn't be sleeping on the EDT.
    I'm not sure what your sleep is trying to do but you need to manage your threads a little more carefully. For instance, any time consuming process which is invoked as a result of a UI event needs to be fired on a new thread to prevent the UI freezing. The fun starts when you have to update the UI as a result of that process, because you should then hook back onto the EDT to avoid the risk of deadlock.
    Some utility classes are provided, such as SwingUtilities, and other example code is provided on Sun's site, such as SwingWorker - but if you do much UI work you'll probably end up with your own core set of threading tools and so on to make life easier.

  • Can LabVIEW threads sleep in increments less than a millisecon​d?

    I am aware of two LabVIEW sleep functions:
    1) All Functions | Time & Dialog | "Wait (ms)"
    2) All Functions | Time & Dialog | "Wait Until Next ms Multiple"
    In this day and age, when 3GHz processors sell for less than $200, it seems to me that a millisecond is an eternity. Is there any way to tell your LabVIEW threads to sleep for something less than a millisecond?
    In Java, the standard Thread.sleep() method is written in milliseconds [sorry, the bulletin board software won't let me link directly]:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/​Thread.html#sleep(long)
    but there is a second version of the method that allows for the possiblity of nanoseconds:
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/​Thread.html#sleep(long, int)
    So there does seem to be some consensus that millisecond sleep times are getting a little long in the tooth...

    Hi Tarheel !
    May be you should get some idea of the kind of timing accuracy that you can reach when using a loop.
    Use the attached vi, which runs repeatedly a For loop (10 iterations) reading the time, then calculate the average and standard deviation of the time difference between the loop iterations.
    On my PC (P4, 2.6 MHz, W2K), I get a standard deviation of about 8 ms, which appears to be independent of the sleep duration I asked for.
    Same thing with a timed loop.
    Under MacOS X (PowerBook, 1.5GHz), the SD falls down to 0.4 ms.
    I tried to disable most of the background processes running on my PC, but I could not get a better resolution.
    Seems that the issue is not in LV but on the way the OS manage its internal reference clock.
    Since you are a Java afficionado, may be you could produce something equivalent ?
    A proof that nanosecond resolution is available on a PC could be of great help to NI. Why bother with costly timers on DAQ cards ?
    By the way, it took me about one minute to create the attached vi. I would like to have an idea of the time required to do the same thing in Java.
    Tempus fugit...
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Timing precision.zip ‏11 KB

  • After 10.9.6 update, laptop keeps going to sleep

    After doing the 10.9.6 updates last night, my computer keeps going to sleep, even right in the middle of typing, the screen goes black and the lights on the keyboard go off.  I have to hit a key on the keyboard or tap the touchpad to wake it back up, and re-enter my password.  I am also running os x server installed on this laptop and did that update, along with xcode 6
    Here are my logs from the console:
    9/20/14 11:10:56.482 AM loginwindow[495]: ERROR | -[LWBuiltInScreenLockAuthLion askForPasswordBuiltIn:] | Attempted to add an observer when already observing
    9/20/14 11:10:56.679 AM WindowServer[127]: CGXDisplayDidWakeNotification [1530601644632]: posting kCGSDisplayDidWake
    9/20/14 11:10:56.680 AM WindowServer[127]: handle_will_sleep_auth_and_shield_windows: Deferring.
    9/20/14 11:11:06.484 AM loginwindow[495]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:11:09.043 AM loginwindow[68]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:11:09.085 AM loginwindow[68]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:11:26.601 AM WindowServer[127]: _CGXSetWindowBackgroundBlurRadius: Invalid window 0xffffffff
    9/20/14 11:11:26.602 AM loginwindow[68]: find_shared_window: WID -1
    9/20/14 11:11:26.602 AM loginwindow[68]: CGSGetWindowTags: Invalid window 0xffffffff
    9/20/14 11:11:26.602 AM loginwindow[68]: find_shared_window: WID -1
    9/20/14 11:11:26.602 AM loginwindow[68]: CGSSetWindowTags: Invalid window 0xffffffff
    9/20/14 11:11:26.669 AM WindowServer[127]: device_generate_desktop_screenshot: authw 0x7fbd68432cf0(2000), shield 0x7fbd68578280(2001)
    9/20/14 11:11:26.688 AM WindowServer[127]: device_generate_lock_screen_screenshot: authw 0x7fbd68432cf0(2000), shield 0x7fbd68578280(2001)
    9/20/14 11:11:27.783 AM loginwindow[495]: ERROR | -[LWBuiltInScreenLockAuthLion askForPasswordBuiltIn:] | Attempted to add an observer when already observing
    9/20/14 11:11:27.979 AM WindowServer[127]: CGXDisplayDidWakeNotification [1561902351016]: posting kCGSDisplayDidWake
    9/20/14 11:11:27.980 AM WindowServer[127]: handle_will_sleep_auth_and_shield_windows: Deferring.
    9/20/14 11:11:39.821 AM loginwindow[68]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:11:49.770 AM loginwindow[68]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:11:57.884 AM WindowServer[127]: _CGXSetWindowBackgroundBlurRadius: Invalid window 0xffffffff
    9/20/14 11:11:57.885 AM loginwindow[68]: find_shared_window: WID -1
    9/20/14 11:11:57.885 AM loginwindow[68]: CGSGetWindowTags: Invalid window 0xffffffff
    9/20/14 11:11:57.886 AM loginwindow[68]: find_shared_window: WID -1
    9/20/14 11:11:57.886 AM loginwindow[68]: CGSSetWindowTags: Invalid window 0xffffffff
    9/20/14 11:11:57.976 AM WindowServer[127]: device_generate_desktop_screenshot: authw 0x7fbd68739610(2000), shield 0x7fbd68578280(2001)
    9/20/14 11:11:57.984 AM WindowServer[127]: device_generate_lock_screen_screenshot: authw 0x7fbd68739610(2000), shield 0x7fbd68578280(2001)
    9/20/14 11:11:58.056 AM WindowServer[127]: _CGXHWCaptureWindowList: No capable active display found.
    9/20/14 11:11:58.957 AM loginwindow[495]: ERROR | -[LWBuiltInScreenLockAuthLion askForPasswordBuiltIn:] | Attempted to add an observer when already observing
    9/20/14 11:11:59.150 AM WindowServer[127]: CGXDisplayDidWakeNotification [1593074141698]: posting kCGSDisplayDidWake
    9/20/14 11:11:59.151 AM WindowServer[127]: handle_will_sleep_auth_and_shield_windows: Deferring.
    9/20/14 11:12:08.898 AM Dock[526]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:12:09.005 AM loginwindow[495]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.
    9/20/14 11:12:10.905 AM loginwindow[68]: CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces.

    Resetting SMC doesn't work
    Apple is dying
    After 10.9.5 update,
    1. Go to sleep
    2. Wake up from sleep
    3. After step 2, macbook keeps going to sleep per 5 to 20 seconds
    4. After restart, back to normal
    1 > 2 > 3 > 4 > 1 > 2 > 3 > 4 >...

  • IPhone - Trying to Update View from Separate Thread

    I am having trouble updating a view. My iPhone project is built from the Utility Application template. Upon startup, the Main View is loaded and some network communications are performed (on a separate thread). In response to the reply from the network, the toggleView method is called to switch to FlipSideView.
    This works (view changes) when I call toggleView from applicationDidFinishLaunching or by pressing the "i" button on the MainView. When I call toggleView after getting a response from the network, toggleView is called (as evidenced by a NSLog called within the toggleView method) but the View does not update.
    Does anyone have any ideas why this would happen?
    Could it have anything to do with the fact that I'm calling toggleView from another thread? If so, why would toggleView be called but not work?
    Thanks in advance,
    Daedalus
    - iPhone SDK Beta 8

    Update... I figured it out.
    To anyone else seeing this, when communicating between threads, you need to use the NSObject method performSelectorOnMainThread.
    Thanks.

  • Thread.yield() and Thread.sleep(), what's the difference

    Folks'es,
    can anyone enlighten me, as to the difference between yield() and sleep() in the Thread class?
    i know, with sleep, one can specify the amount of time to sleep, but does that mean the thread yields for that amount of time?
    if i use yield(), how long will my thread stop running?
    any information is appreciated
    thomas

    Thread.yield() is used to give other threads a chance to get a processor time slice, according to the thread dispatcher rules. If there are no other threads ready to run, the current thread will gain the processor again.
    Thread.sleep() will always release the processor for at least the amount of time specified, even if there are no other threads requesting it.

  • Hello i hav an ipad mini and i was in the middle of the ios 8 update and i held the sleep and home button at the same time to cancel the update and now it wants me to connect to itunes i dont no how to do that can someone pleaze help me

    hello i hav an ipad mini and i was in the middle of the ios 8 update and i held the sleep and home button at the same time to cancel the update and now it wants me to connect to itunes i dont no how to do that can someone pleaze help me?

    RECOVERY MODE
    1. Turn off iPad
    2. Turn on computer and launch iTunes (make sure you have the latest version of iTune)
    3. Plug USB cable into computer's USB port
    4. Hold Home button down and plug the other end of cable into docking port.
    DO NOT RELEASE BUTTON until you see picture of iTunes and plug
    5. Release Home button.
    ON COMPUTER
    6. iTunes has detected iPad in recovery mode. You must restore this iPad before it can be used with iTunes.
    7. Select "Restore iPad"...
    Note:
    1. Data will be lost if you do not have backup
    2. You must follow step 1 to step 4 VERY CLOSELY.
    3. Repeat the process if necessary.

  • Work manager using thread.sleep or delay doesn't work

    Hi all,
    I used Spring framework and oracle weblogic 10.3 as a container.
    I used workmanager for manage my thread, I already made one thread that managed by workmanager. Fortunately spring provide the delegation class for using workmanager, so I just need to put it on applicationContext.xml.
    But when I put the "while" and TimeUnit for sleep the process on desired delayed time, the deployment process never finished. It seems the deployment process never jump out from while loop for finishing the deployment.
    Why?, As I know using typical thread, there is no issue like this. Should I use another strategy for make it always loop and delay.
    This is my simple code :
    import java.util.concurrent.TimeUnit;
    import org.springframework.core.task.TaskExecutor;
    public class TaskExecutorSample{
         Boolean shutdown = Boolean.FALSE;
         int delay = 8000;
         TimeUnit unit = TimeUnit.SECONDS;
         private class MessageGenerator implements Runnable {
              private String message;
              public MessageGenerator(String message){
                   this.message = message;
              @Override
              public void run() {
                   System.out.println(message);
         private TaskExecutor taskExecutor;
         public TaskExecutorSample(TaskExecutor taskExecutor){
              this.taskExecutor = taskExecutor;
              try {
                   while (shutdown.equals(Boolean.FALSE)){
                        this.printMessage();
                        unit.sleep(delay);
              } catch (Exception e) {
                   System.out.println(e.getMessage());
         public void printMessage() {
              taskExecutor.execute(new MessageGenerator("Print this Messages"));
    Really thanks in advance.
    Regards,
    Kahlil
    Edited by: Kahlil on May 26, 2010 2:38 PM
    Edited by: Kahlil on May 26, 2010 2:42 PM

    Hi,
    i m not sure whether it's an issue with Spring or not. But i tried using Thread.sleep(1000) in a Simple webapplication to see Workmanagers works properly or not. I found that it works extremely great: http://weblogic-wonders.com/weblogic/2010/01/24/workmanager-at-webapplication-level/
    Thanks
    Jay SenSharma

  • How can I download/update my contacts between my MacBook address and my iPhone 5?

    Hi,
    Can anyone help me on this problem?
    How can I download/update my contacts between my MacBook address and my iPhone 5? They don't sync with each other.  Thanks

    Welcome to Apple Discussions, Catwang!
    You can use iTunes to sync the two devices. See the KB article, iOS: How to transfer or sync content to your computer and iTunes for Mac: sync contacts, calendar and other info.
    If you want to use iCloud, your MacBook  needs to use at least OS 10.7.4 or later. See Set up iCloud on all your Devices.
    HTH

Maybe you are looking for

  • J2EE Containers in 9.0.3.0.0 (Preview 3/25/02) don't handle custom UserManager

    I can't see any other place to report this, so I guess I'll do it here. We've written a custom UserManager that works in Orion 1.5.2 and, of course, Oracle J2EE Containers 1.0.2.2 but it gets stuck in an infinite loop calling the following function.

  • Idt hd audio codec suddenly stopped working - windows 8.1

    idt hd audio codec suddenly stopped working with 8.1.  Windows update and it stopped working, maybe a coincidence. Error message: Windows cannot load the device driver for this hardware. The driver may be corrupted or missing (code 39).

  • Universally replace one character with another and then change font

    Hello, I have a geologic map file where there are hundreds of labels like Cc, Cz, Cwu, etc... all in the Arial font. I need to change all of the capital C's with a character from the StratagemAge font. That is to say, I need to find all instances of

  • How can I save a value in PO cache?

    Hi to everyone, My problem is: I have an integration SOAP to SOAP on PO 7.4,  the first step is obtain a TOKEN, then I want to save this token in cache or PO database, beacuse later I'll can use this token in other operation from other integration. 

  • Custom Personalization Dialog

    Greetings, all I would like to create a custom personalization dialog by cloning and editing the code for my iViews' standard personalization dialog into my iViews' par file Java class (using method doEdit). I have been studying the Javascript (page