Re: Sleep API function
- From: "Bob Butler" <tiredofit@xxxxxxxxxx>
- Date: Mon, 15 Aug 2005 09:34:40 -0700
"Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:uPkzFWboFHA.3912@xxxxxxxxxxxxxxxxxxxx
> "Bob Butler" <tiredofit@xxxxxxxxxx> wrote in message
> news:uDzZZ7aoFHA.568@xxxxxxxxxxxxxxxxxxxxxxx
>>
>> good point; i'm using windows 2000 SP4 and VB6 SP5
>
> Okay, well 2000 should be more responive than 95/98/ME and such. You
> probably know that. So that possibility is eliminated.
>
>> but it is unrelated
>
> It depends on how "related" is defined. They are related to the
> extent that the OS is scheduling and switching and such.
>
> Note that the Sleep documentatin says "You have to be careful when
> using Sleep ....".
I haven't seen the doc for a while and don't have it availabel to check but
IIRC the warnings are mainly because it makes the app that is calling it
unresponsive. I don't ever recall seeing a warning about it making other
applications unresponsive!
> Which is enough for me to expect unexpected
> behavior such as what you describe. Of course, you are asking if
> anyone else has actually had this type of thing happen. I am just
> saying that you seem to think it is not normal, but it might be nore
> normal than you realize.
I'm sure it's been happening all along so if that makes it "normal" then you
are right. OTOH I can't think of any reason why searching for files from
windows explorer should be affected in any way by another app sitting in a
Sleep state.
>> I've used ALT-TAB or clicked a taskbar icon to switch
>> to explorer while the VB app runs in the background. This came up
>> from other scenarios where the actual delay was being done in an app
>> started by SMS without the user's knowledge and there is no
>> relationship between the real app and the user's tasks except that
>> Explorer hangs starting a search.
>> I left that out because I was able to duplicate it so easily in the
>> VB IDE.
>
> Sorry, I don't understand all that. Is Sleep relevant there or do you
> not know if it is? Are you saying that you are experiencing a delay
> and you are attempting to determine the cause?
I'm saying that while my VB app is waiting for a Sleep period to end windows
explorer also seems to wait when starting a search. As far as I can tell
they appear to be related but I can't fathom why.
>> [pet peeve]BTW, it's 'effect', not 'affect', unless you are saying
>> this is just an affectation of explorer (which I'm beginning to
>> believe) <g>[/petpeeve]
>
> I understand about pet peeves, such as use of "may", as in "they may
> do it". In junior high school, I used either "effect" or "affect" in
> a paper and the teacher commented. I explained why I used the word I
> used and that was that; I think the teacher did not originally
> understand what I meant. I am not an expert, and you might be right.
> The word "affect" still seems correct to me, but you could be
> correct. I think I meant that Sleep affects the system. The effect is
> that the system is less responsive.
Just that Sleep in one app doesn't normally affect other apps (the system)
but does appear to affect this one thing and that strikes me as unusual and
worth understanding better.
> I think VB programmers are more likely to use Sleep, but C/C++
> programmers also use Sleep. See my "Using Waitable Timers" for a
> simple sample alternative to use of Sleep(). It is written using C++
> but I am nearly certain I have seen similar versions using VB.
Yes, I know of other methods and will probably switch to one. In this case
it was a background app that I didn't care would show as 'not responding'
now and then so I didn't feel it worth the effort to use an alternate
approach. If I can confirm that Sleep has this effect on windows explorer
(and by extension possibly on other apps) then I may just abandon Sleep
completely. I'm just lookign for some feedback to see if others have seen
this and if anybody knows what the conenction is.
--
Reply to the group so all can participate
VB.Net: "Fool me once..."
.
- Follow-Ups:
- Re: Sleep API function
- From: Larry Serflaten
- Re: Sleep API function
- From: Sam Hobbs
- Re: Sleep API function
- References:
- Sleep API function
- From: Bob Butler
- Re: Sleep API function
- From: Sam Hobbs
- Re: Sleep API function
- From: Bob Butler
- Re: Sleep API function
- From: Sam Hobbs
- Sleep API function
- Prev by Date: Re: Sleep API function
- Next by Date: Re: Add Ports to WinXpSp2's Firewall
- Previous by thread: Re: Sleep API function
- Next by thread: Re: Sleep API function
- Index(es):
Relevant Pages
|