Ozguxxx wrote:
What I need to know is what can a real time schedule be in "our" understanding of real-time scheduling, for example is reading a floppy a real-time task?
That's a popular misunderstanding. "Real-time" has nothing to do with "real quick". Rather, it is about being able to
guarantee that e.g. an interrupt handler will be executed no longer than X after the interrupt was raised. For some
crucial applications (like nuclear power plants or medical appliances, or e.g. professional audio equipment, weapon technology etc.), that's a requirement.
Everything else is usually "best effort", or "soft real-time", which is a completely different ballgame.
You can write a really efficient, multimedia-enabled OS without ever touching the issue of hard real-time.
Quote:
How is it implemented in your code?
Check out "Rate Monotonic Scheduling".
Quote:
Also I think two real-time tasks cannot run in same system, right? I mean say they are unrelated to each other.
Wrong.
A real-time task, when starting up, hands the RTOS data on its run-time requirements (periodicity, latency etc.). That's the most obvious difference between hard and "soft" real time: The
application must provide this data in a hard real-time environment! The thing is, that is only possible if the hardware and the OS version are known beforehand, i.e. at compile time of the application.
That's why hard real-time is such a special case: You just cannot do it correctly in a generic desktop OS. Hard real time is almost by definition a thing for embedded systems.
The system then decides if it can fulfill the requirements of the application. If yes,
there must be no way that guarantee is broken.
With Rate Monotonic Scheduling, a system can guarantee that all requirements are met as long as CPU load does not exceed 69%. (That's why an application must tell the system in advance how much CPU load it adds to the system...)
As long as the guarantee can be given, there's nothing keeping
any number of applications from running in real-time, concurrently, on the same hardware.
Unless you are into embedded systems, I'd daresay you can safely forget about hard real-time altogether. AmigaOS, fabled for its efficiency and multimedia capabilities back then, was a simple round-robin priorised scheduler with no concept of real-time...