ihsan@ficc.ferranti.com (jaleel ihsan) (06/30/90)
Keeping in mind the real-time requirements, the only acceptable way I can keep my own timer in the application (as opposed the OS keeping it for me) is if the the OS provides me a function to "read data or time-out" such that the time out is implemented in an interrupt/event driven manner. (Unfortunately this is not available to me, and this is what I am trying to get from my TCP-IP vendor.) Sleeping for 1 second and rechecking if data is there yet or not, (and repeating this for 15 seconds, in case I want a 15 second time-out) is unacceptable for my real-time application for the following reasons (which happen to be some very basic real-time design considerations): 1. Data may arrive just as I go to sleep. In this case the data processing will be delayed by a WHOLE second. This is unacceptable. 2. In order to reduce the aforementioned data processing delay, I cannot reduce by sleep timer (say form 1 to 0.1 sec), because the program that is trying to read data (and has to be one of the high priority tasks) will use up the CPU resource just checking if the data is there or not. This is unacceptable too ! Real life happens to be little more complicated in real-time and thats why I like real-time applications !!!