Re: Better polling solution in wince driver

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You could call WaitForSingleObject(), WaitForMultipleObjects(), not call
wait at all. All will affect performance in some way or another...

Paul T.

"shiju" <mshiju@xxxxxxxxx> wrote in message
news:4581BBB5.1090906@xxxxxxxxxxxx
Hi,
I am new to wince and was just worried whether the Sleep() function would
affect the performance of the system. Is this the only way to implement
polling in wince 5.0 drivers.

Thanks,
Shiju
Henrik Viklund wrote:
shiju skrev:
Hi,
I am implementing a touchpad driver (that has no interrupts) using
polling mechanism. This device is connected to i2c lines. So the only
way to get the data is to poll the device every fixed time interval. In
our case it should be every 40-50 ms.This is the only pointing device on
the system.

I can't really see what the problem is running a 25Hz polling cycle
using Sleep(), but since you keep asking for alternatives, what about
it do you find unsatisfying?

Henrik Viklund
http://www.addlogic.se

Thanks,
Shiju

Henrik Viklund wrote:
shiju skrev:

Hi,
Sometime back I asked a question regarding implementation of polling
in
wince-5 device drivers. The answer to my question was to use Sleep()
function. So I implemented this in my driver by creatiing a thread. In
the thread process I have an infinite while loop with a Sleep()
function. The device I am polling is a pointer device and I need to
poll
this device every 40 millisec-50 millisec. Is there a better way to
poll
this device.
Um, no? Why do you think you need a better way? Without knowing
anything about your application I'd say that a 40-50ms deadline usually
is no match to meet using Sleep() -provided you've got the thread
priorities set up correctly.

Henrik Viklund
http://www.addlogic.se

Thanks,
Shiju



.



Relevant Pages

  • Re: Better polling solution in wince driver
    ... I am new to wince and was just worried whether the Sleep() function would affect the performance of the system. ... Is this the only way to implement polling in wince 5.0 drivers. ... Henrik Viklund wrote: ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Better polling solution in wince driver
    ... I can't really see what the problem is running a 25Hz polling cycle ... Henrik Viklund wrote: ... The answer to my question was to use Sleep() ... So I implemented this in my driver by creatiing a thread. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Safety - who has final say??
    ... CDL doens't mean you can expect to find a compatible dispatch from nearly ... hours in any one stretch, he may sleep a few times in a day to get his ... strict pet policy would help responsible drivers with OTR pressures. ... The primary cause of terrorism is that it works. ...
    (misc.transport.trucking)
  • [PATCH] timer: Added usleep[_range][_interruptible] timer
    ... precise enough for many drivers (yes, sleep precision is an unfair notion, ... Obviously not every udelay can be replaced (those in atomic ... so if someone wanted to be interruptible for a few usecs, ... of itself -- many people are using a delay API where a sleep will suit them ...
    (Linux-Kernel)
  • Another money grab looming
    ... Two advisory committees agreed Wednesday to approve recommendations ... billions of dollars to be spent on sleep medicine industry products ... to recommend that drivers with a body mass index of 35 or greater be ... required to ?be evaluated for obstructive sleep apnea,? ...
    (misc.transport.trucking)