??? 12/02/05 17:44 Read: times |
#104602 - Real Time Responding to: ???'s previous message |
I don't know how you guys dug yourselves into this mess, but I'll try and make it worse. ;-)
One needs to dial back the clock about 20 or 30 (or 40?) years to get the origin. Real Time (as applied to an OS) simply means that the OS responds (can context switch) in a timely manner to an event (such as an interrupt -- external or internal). This is in contrast to early time-sliced multitisking systems such as early UNIX where user's were given the illusion of simultaneous use of a mainframe or mini because the OS time-sliced all the users. This then extends to the PC such that multiple apps or users (say in a control environment) can run on a PC and share PC resources. Note that I didn't mention Windows, just PC. You wouldn't want to use vanilla Windows or UNIX because an event might occur and then the thread or appl waiting for it would have to sit there until it's time slice came around to find out. And I just know that someone is going to pick at the term "timely" but that simply means that things get done when they need to. If you need uS then you need uS, if you need weeks then that can be accomodated too. Fast really has little to do with it except that when you define the specs for your system you should know how fast you need to respond to the various stimulti. When shopping for an RTOS you can use that as your benchmark. They all specify context switch time (how much time OS takes to save context, evaluate which task should run next and then retore context). You need to apply the numbers the RTOS vendor gives you to your system specifically considering your own processor clock speed (or MIPs) and in some cases C compiler. Context switch time is the sum of Save Context + Context Switch Decision Time + Context Restore Time + worst case interrupts desabled time. As mentioned in my other post today, your ISR's are not impeded from acting at the raw hardware speed. The Save and Restore times are pretty trivial because it's generally just moving the stack pointer. [Venturing into muddier waters at the back of my memory...] The reason I omitted Windows is that unless you are buying a flavour of CE, you shouldn't design a real-time system around Windows because the vendor can't guarantee context switch time. Windows has for a long time been event-driven, but not deterministic. I think CE has been deterministic for a while now, albeit long (shady?) on context switch time, but I've never implemented it (meaning brought it up from scratch on a board of our design). You can buy RTOS's for a desktop PC (I think anyway, it's been a long time since I researched such things -- but QNX comes to mind). Then there is the whole realm of Soft-Real-Time... ;-) GB |