Re: Re-entrancy???
- From: "Bill McCarthy" <Bill@xxxxxxxxxxxxx>
- Date: Thu, 18 Dec 2008 14:51:30 +1100
"Karl E. Peterson" <karl@xxxxxxxx> wrote in message news:etF9DRLYJHA.1328@xxxxxxxxxxxxxxxxxxxxxxx
Bill McCarthy wrote:If Do Events didn't yield then obviously the loop
would make the entire system unresponsive whilst it was running.
That's patently false, because Windows will still be slicing off time slots, and there's no way any VB program can prevent that.
--
Nope, you're wrong here too. Perhaps if you took the time to research these things before going on a flame rampage you'd see that. I see you've already been corrected about DoEvents calling Sleep(0). Pity you posted half a dozen "attacks" prior to that especially as this has already been covered in this thread.
As to the above, it's a demonstrable and measurable effect. Create an application that has two loops, one that calls DoEvents in it the other not. Then run another app that runs a lengthy process. If you run the first app without the DoEvents, the second app will take longer to complete on a single processor machine, then if you run the first app with DoEvents. This measurable time difference is the period the system is "unresponsive" because your app is not yielding to the OS.
See also the documentation on MSDN for the Sleep function, where it clearly says:
"A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. "
.
- Follow-Ups:
- Re: Re-entrancy???
- From: Mike Williams
- Re: Re-entrancy???
- From: Karl E. Peterson
- Re: Re-entrancy???
- References:
- Re: Re-entrancy???
- From: Karl E. Peterson
- Re: Re-entrancy???
- Prev by Date: Re: Set Forms StartUpPosition in Code?
- Next by Date: Re: Opentextfile TriStateMixed
- Previous by thread: Re: Re-entrancy???
- Next by thread: Re: Re-entrancy???
- Index(es):
Relevant Pages
|