I have a piece of hardware that is connected to my PC via the PCI bus. I am accessing the hardware through a .NET wrapper around the device driver.
I do not have any specifications on how the device is performing PCI-wise. Which brings me to my first question.
1) Are devices connected through PCI guaranteed to deliver data at a certain speed?
2) When communicating with the device, I would like my UI to stay responsive. Is it a good idea to kick off communication with the device in a (threadpool) thread, or is the overhead associated with this too large compared to how fast accessing the PCI bus is?
Edit:
Question rewritten. Reflected too much the end of a long work day.
Removed the requirement for the thread to be a thread pool thread.
In general, any time you have the opportunity to write code without thread affinity, it's often a good idea to do so. That way you have the freedom to switch off the UI thread when and if it becomes a responsiveness problem. Designing your API for this I/O using Async methods also keeps your options open going forward in a good way.
Whether the thread you're on is a threadpool thread or one you spawn yourself seems irrelevant if you don't have to occupy it for long periods of time. And if you can do Async I/O then a threadpool thread should be fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With