Does anybody know any good websites that explain more on Polling vs. Interrupts. I have already googled it but the explainations are limited to one slide/page.
Thanks
Does anybody know any good websites that explain more on Polling vs. Interrupts. I have already googled it but the explainations are limited to one slide/page.
Thanks
depends on the port. If you are talking about high-traffic ports like COM1, COM2 etc then you really should use interrupt driven device driver to get the data as it comes into the computer. If you don't there is a high chance that the program will lose some data. serial port UARTs have very limited storage capacity, newest ones can hold about 16 characters before overwriting data.
How to do that depends entirely upon the operating system you are using. MS-DOS is different than MS-Windows, which is different than *nix, or Vax.
in general, I want to know the advantages and disadvantages of each. The reason why I asked is that I get error messages when testing and it goes away 30 seconds later. This occurs occasionally.
Last edited by NewGuy100; 09-29-2005 at 03:20 PM.
The error message is not related to which method is used. It comes from the program you are running. Its impossible to say what causes the error message without knowing more about the program and seeing some code. Generally, interrupt method is preferred over polling method because of what I mentioned in my previous post.
Polling:
A: Easy to write and test
D: Harder to manage data overruns, lost messages etc if you don't poll often enough
Interrupt:
A: Less chance of data loss, but make sure interrupts are not locked out for extended periods
D: Harder to write and test - all the problems of concurrency come out.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.