Right now every 1 ms an event is signaled in the OnTimer() function and the
thread which is waiting on the event will resume. The problem is that not
exactly every 1 ms the OnTimer() function is called because the WM_TIMER
message is put in the messagequeue of the application. Is there a possible
way, that the produced WM_TIMER message (every 1 ms) is not put in de queue
of the application but in a queue of the thread? The thread then only has
WM_TIMER messages and no other messages so maybe I can guarantee the time of
1 ms???
Thank you,
Johan Machielse
lpfnTimer
Specifies the address of the application-supplied TimerProc callback
function that processes the WM_TIMER messages. If this parameter is NULL,
the WM_TIMER messages are placed in the application's message queue and
handled by the CWnd object.
I thought about this when putting it into my gol prog.
--
----------------------------------------------------------
REMOVE all capital letters to email me
Sorry, but I've had another account end
up on all the junk lists, and it gets 40+
messages a day all junk :-(
"Johan Machielse" <JohanMa...@netscape.net> wrote in message
news:eKMsEU1r$GA.216@cppssbbsa03...
The granularity of WM_TIMER through SetTimer() API is 16ms, which mean
if you select 40ms to be awaken, it would happen arround 32 - 48 ms.
The minimum with SetTimer is therefore 16ms.
You need to use Multimedia Timer for a smaller resolution, but I guess anyhow
that you would never get 1ms guaranteed.
Jean-Marc
Johan Machielse <JohanMa...@netscape.net> wrote in message
news:eKMsEU1r$GA.216@cppssbbsa03...
>You need to use Multimedia Timer for a smaller resolution, but I guess anyhow
>that you would never get 1ms guaranteed.
Correct. I ran a test using the performance counters to check the
resolution of multimedia timers and they're OK most of the time, but
sometimes the machine just goes away and plays with the fairies for a
while, and there's little you can about it, even if you up your thread
priority. I later found out that this was commonly the fault of
ATAPI.SYS, though I understand some badly written graphics drivers can
also disable interrupts for lengthy periods.
Bottom line is, Win32 ain't an RTOS.
--
Bob Moore [MVP]
http://www.mooremvp.freeserve.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to an unreasonable amount of queries, I no
longer answer unsolicited email questions. Sorry,
no exceptions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Wed, 26 Apr 2000 21:29:22 +0100, Bob Moore <bo...@mvps.org> wrote:
>sometimes the machine just goes away and plays with the fairies for a
>while, and there's little you can about it, even if you up your thread
>priority.
The IDE controller can starve the CPU for extended periods as well. I
have lately started ordering SCSI drives for machines intended to run
this kind of program.
>Bottom line is, Win32 ain't an RTOS.
Amen, brother.
Regards,
Kurt
On Wed, 26 Apr 2000 09:59:53 +0200, "Johan Machielse"
<JohanMa...@netscape.net> wrote:
>Hello,
>
>Right now every 1 ms an event is signaled in the OnTimer() function and the
>thread which is waiting on the event will resume. The problem is that not
>exactly every 1 ms the OnTimer() function is called because the WM_TIMER
>message is put in the messagequeue of the application. Is there a possible
>way, that the produced WM_TIMER message (every 1 ms) is not put in de queue
>of the application but in a queue of the thread? The thread then only has
>WM_TIMER messages and no other messages so maybe I can guarantee the time of
>1 ms???
>
>Thank you,
>
>Johan Machielse
>
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm