Take a Nap
-
Sometimes I shake my head. Found this gem in some stuff I wrote 7 or 8 years ago.
Sleep(15); // Just Sleep to block the thread and the message queue will clear. (crosses fingers :) )
I especially like the smiley in the comment. :doh:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
Sometimes I shake my head. Found this gem in some stuff I wrote 7 or 8 years ago.
Sleep(15); // Just Sleep to block the thread and the message queue will clear. (crosses fingers :) )
I especially like the smiley in the comment. :doh:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
But it does sound like a splendid idea right now
-
Sometimes I shake my head. Found this gem in some stuff I wrote 7 or 8 years ago.
Sleep(15); // Just Sleep to block the thread and the message queue will clear. (crosses fingers :) )
I especially like the smiley in the comment. :doh:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
I saw similar code recently, stuff running on another thread at the time. It all worked wonderfully until someone ran it from an old, slow, low memory machine where the wait wasn't long enough! Now where is the
GoBackToSleepABitMore()
command? It works on my kids. :laugh:If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
-
I saw similar code recently, stuff running on another thread at the time. It all worked wonderfully until someone ran it from an old, slow, low memory machine where the wait wasn't long enough! Now where is the
GoBackToSleepABitMore()
command? It works on my kids. :laugh:If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
Really.. You have to teach me that one. Mine get up at 6:00AM on weekends, even if I make it impossible for them to watch cartoons or play video games.
-
Sometimes I shake my head. Found this gem in some stuff I wrote 7 or 8 years ago.
Sleep(15); // Just Sleep to block the thread and the message queue will clear. (crosses fingers :) )
I especially like the smiley in the comment. :doh:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
Hmmm. Did something similar a while ago when I wrote my first multithreading application. It was getting three datasets from a database and needed all three to finish before moving on. Initially, I had the sleep before I got the threads to synchronise properly. However, I forgot to take the sleep out. Application went into Production and only after a complaint a few months later did I investigate and find the gem. Good thing was that I looked like a hero because I made the application so much quicker. One of these days I'll own up!
-
Really.. You have to teach me that one. Mine get up at 6:00AM on weekends, even if I make it impossible for them to watch cartoons or play video games.
keep them up late on friday night usually works. of course you don't get enough sleep either way!
If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850) [My Articles] [My Website]
-
Hmmm. Did something similar a while ago when I wrote my first multithreading application. It was getting three datasets from a database and needed all three to finish before moving on. Initially, I had the sleep before I got the threads to synchronise properly. However, I forgot to take the sleep out. Application went into Production and only after a complaint a few months later did I investigate and find the gem. Good thing was that I looked like a hero because I made the application so much quicker. One of these days I'll own up!
Nah, those are the things we build our reputations on. :)
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
Sometimes I shake my head. Found this gem in some stuff I wrote 7 or 8 years ago.
Sleep(15); // Just Sleep to block the thread and the message queue will clear. (crosses fingers :) )
I especially like the smiley in the comment. :doh:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
I had an occasion where
Sleep()
was required to make something work. We had a third-party library we used to communicate with some USB hardware. The library didn't synchronize properly with the device driver, so you had to follow your calls to the library withSleep()
calls of various durations X| .Software Zen:
delete this;
-
I had an occasion where
Sleep()
was required to make something work. We had a third-party library we used to communicate with some USB hardware. The library didn't synchronize properly with the device driver, so you had to follow your calls to the library withSleep()
calls of various durations X| .Software Zen:
delete this;
Gary Wheeler wrote:
The library didn't synchronize properly with the device driver, so you had to follow your calls to the library with Sleep() calls of various durations.
Hmmm, (pondering whether this Sleep() will fix a BlueTooth sync problem we're experiencing....) :doh:
Gary
-
I had an occasion where
Sleep()
was required to make something work. We had a third-party library we used to communicate with some USB hardware. The library didn't synchronize properly with the device driver, so you had to follow your calls to the library withSleep()
calls of various durations X| .Software Zen:
delete this;
[Showing my age!] I remember back when the PC AT came out, with a (WOW!) 80286 clocked at 6 Mhz. You had to write two NOPs after every OUT instruction, I think it was. Otherwise the I/O bus got its tits in a tangle.
Software rusts. Simon Stephenson, ca 1994.