Re: Thread Priority



Ah - it's that Sleep() function again !
Calling Sleep(20) in the polling loop calms everything down !
And I can still respond to a pulse >20ms on the I/O line.
Is that the recommended way ? Seems to work fine ...

"Kevin Urben" <me@xxxxxxxxxxxx> wrote in message
news:02bb100d$0$8028$c3e8da3@xxxxxxxxxxxxxxxxxxxx
Hi,

I am running a thread to monitor the state of an I/O line on a NI PCI 6503
Digital I/O board.
The thread reads the port continuously and waits for a change on the line.
When detected, it fires off a message to the app. message queue to start a
measurement.
It all works fine, except that the thread consumes all the CPU cycles on
one
core when nothing else is happening ! Maybe I shouldn't worry, but on a
laptop that causes the CPU to max out and waste power. I could lower the
thread priority - not sure what that would do. In truth, I probably only
need to read the port 20 times per second. Any suggestions ? Would a timer
be better ?

Thanks for reading !

Kevin






.



Relevant Pages

  • Re: First post: best place for this?
    ... count the time intervals between successive taps of my toe, ... and flash a light at that interval. ... into a pulse counter. ... Each family has small, cheap i/o devices, with ...
    (sci.electronics.basics)
  • Re: multidimensional array order in memory
    ... But page faults also cost ... some cpu cycles, not as much as I/O, but still significant. ... many cpus have arithmetic instructions in which memory ...
    (comp.lang.fortran)
  • Re: CPU Eaten up
    ... >I have a process, PQV2iSvc.exe, which is eating>50% of my CPU cycles and ... >is WAY up in the page fault and i/o reads. ...
    (microsoft.public.windowsxp.general)
  • Re: CPU Eaten up
    ... |>I have a process, PQV2iSvc.exe, which is eating>50% of my CPU cycles and is ... |>WAY up in the page fault and i/o reads. ...
    (microsoft.public.windowsxp.general)
  • Re: CPU Eaten up
    ... >I have a process, PQV2iSvc.exe, which is eating>50% of my CPU cycles and ... >is WAY up in the page fault and i/o reads. ...
    (microsoft.public.windowsxp.general)