Hi Guys

I have a windows application and device driver using a piece of data
acquisition hardware.
When the data has been acquired I use the device driver to read back
the data. Its read back byte by byte and there is a lot to read back.
At the moment I don't have any threads operating so when the device
driver is reading back the data the User interface is locked out.

So what I'm going to do is create a thread that operates in the
background always waiting for the data ready signal and then reading
the data back when its available. It would have lower priority than the
User Interface thread and so should not effect its operation.

My question is this. Should I create a thread in the kernel i.e.
created by the device driver, Or should I create a thread at the
application level which owns the device driver(i.e. opens it
communicates with it etc.)?

Creating a thread in the device driver is easier for me given the
current software architecture. If I change, to create a new application
level thread then all existing communication between the User Interface
thread and the device driver would have to be modified to go to, and
then through the new thread.

So Ideally I want to create a new thread in the Kernel. But will it
operate at a lower priority than the User Interface thread and therefor
allow it priority.

All help appreciated.

Denis
____________________
Centron System Solutions
http://www.CentronSolutions.com

Re: Kernal or application thread - Help by Alexander

Alexander
Tue Jun 28 23:19:40 CDT 2005

Poorly designed devices are a bane of programming. Check your device spec
and see whether you have a "data ready interrupt", or any other sensible
flow control means, other than simply polling the bit.

If there is no other choice, you can run a kernel thread on priority level
like 4, to do your polling.


<dgleeson3@eircom.net> wrote in message
news:1119993323.596504.33130@g49g2000cwa.googlegroups.com...
> Hi Guys
>
> I have a windows application and device driver using a piece of data
> acquisition hardware.
> When the data has been acquired I use the device driver to read back
> the data. Its read back byte by byte and there is a lot to read back.
> At the moment I don't have any threads operating so when the device
> driver is reading back the data the User interface is locked out.
>
> So what I'm going to do is create a thread that operates in the
> background always waiting for the data ready signal and then reading
> the data back when its available. It would have lower priority than the
> User Interface thread and so should not effect its operation.
>
> My question is this. Should I create a thread in the kernel i.e.
> created by the device driver, Or should I create a thread at the
> application level which owns the device driver(i.e. opens it
> communicates with it etc.)?
>
> Creating a thread in the device driver is easier for me given the
> current software architecture. If I change, to create a new application
> level thread then all existing communication between the User Interface
> thread and the device driver would have to be modified to go to, and
> then through the new thread.
>
> So Ideally I want to create a new thread in the Kernel. But will it
> operate at a lower priority than the User Interface thread and therefor
> allow it priority.
>
> All help appreciated.
>
> Denis
> ____________________
> Centron System Solutions
> http://www.CentronSolutions.com
>