Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - So why isn't every OS real-time?: (10 Items)
   
So why isn't every OS real-time?  
Hi,

I wasn't able to find a clear answer about this online--but what's the tradeoff?  QNX as I understand it is much faster 
than standard, non-'real-time' desktop OSs.  It's also a lot smaller--is it just about size?  Thanks!

Matt
RE: So why isn't every OS real-time?  
Hi, Matthew.

It isn't just about speed or size; a realtime OS has to respond to
events within a deterministic time period. You might like to read the
"Exactly When Do You Need an RTOS" white paper on our website:

  http://www.qnx.com/download/feature.html?programid=8090


Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Matthew Phillips [mailto:community-noreply@qnx.com] 
> Sent: Sunday, July 04, 2010 7:11 PM
> To: qnx4-community
> Subject: So why isn't every OS real-time?
> 
> Hi,
> 
> I wasn't able to find a clear answer about this online--but 
> what's the tradeoff?  QNX as I understand it is much faster 
> than standard, non-'real-time' desktop OSs.  It's also a lot 
> smaller--is it just about size?  Thanks!
> 
> Matt
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post58378
> 
> 
Re: RE: So why isn't every OS real-time?  
Hello,

Thanks, that was really useful, but I couldn't find an answer to my question in it actually.  RTOSs are designed so as 
to maximize timing reliability and honor process priority settings, and they do this by having a very small kernel (to 
minimize non-interruptible time) and farming out as many OS tasks as possible to separate processes.

So why doesn't every OS do this?  When would an RTOS be the *wrong* platform for a particular software project?

Best,
Matt
Re: RE: So why isn't every OS real-time?  
*and by using a different method for scheduling processes, and other differences as well
RE: RE: So why isn't every OS real-time?  
There's a technical article on Foundry27 that might also help:

  http://community.qnx.com/sf/go/doc1161?nav=1

Not all OSs need to be realtime, so there's no point in expending more
effort in making them so. For example, if an application is printing
phone bills, and the bills are a few seconds late, the delay likely
doesn't matter. If an application controls your car's brakes, a delay of
a few seconds (because the OS is busy changing music for you) could be
fatal.

A family sedan could be built like a racing car, but most of the racing
car's features would be unused, and a racing car could be built like a
family sedan, but it might not be very responsive.

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Matthew Phillips [mailto:community-noreply@qnx.com] 
> Sent: Monday, July 05, 2010 11:57 AM
> To: qnx4-community
> Subject: Re: RE: So why isn't every OS real-time?
> 
> *and by using a different method for scheduling processes, 
> and other differences as well
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post58486
> 
> 
RE: RE: So why isn't every OS real-time?  
Do you think we'd actually tell you that Neutrino isn't the right
platform for something? :-)

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 
 

> -----Original Message-----
> From: Matthew Phillips [mailto:community-noreply@qnx.com] 
> Sent: Monday, July 05, 2010 11:56 AM
> To: qnx4-community
> Subject: Re: RE: So why isn't every OS real-time?
> 
> Hello,
> 
> Thanks, that was really useful, but I couldn't find an answer 
> to my question in it actually.  RTOSs are designed so as to 
> maximize timing reliability and honor process priority 
> settings, and they do this by having a very small kernel (to 
> minimize non-interruptible time) and farming out as many OS 
> tasks as possible to separate processes.
> 
> So why doesn't every OS do this?  When would an RTOS be the 
> *wrong* platform for a particular software project?
> 
> Best,
> Matt
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post58485
> 
> 
RE: RE: So why isn't every OS real-time?  
Hi Matt,

  Here is a couple of links you can read that might help you out ... 

    - http://en.wikipedia.org/wiki/Real-time_operating_system 
    - http://en.wikipedia.org/wiki/Kernel_%28computing%29 

  Please note that there are many factors companies use to make a decision as to what is the most appropriate OS for 
their particular software project including:
     - Standards (for example, POSIX to ensure portability)
     - Certifications (for example, a project may have a requirement for SIL 3 certification for safety or EAL 4+ for 
security )
     - Hardware Support (possibly multicore support)
     - Software Ecosystem (for example, a project may need a database or a specialized industrial protocol)
     - Scalability, reliability, performance (based on project requirements)
     - Real time constraints
     - Overall OS architecture
     - Tools
     - Vendor reputation
     - Support options
     - Costs (including licensing costs and engineering costs)
     - Licensing terms / IP issues (Linux comes with viral GPL licensing constraints)

You can only determine what the best solution is for your project by evaluating a good subset of these factors. 

Cheers,

Léo

-----Original Message-----
From: Matthew Phillips [mailto:community-noreply@qnx.com] 
Sent: July 5, 2010 11:56 AM
To: qnx4-community
Subject: Re: RE: So why isn't every OS real-time?

Hello,

Thanks, that was really useful, but I couldn't find an answer to my question in it actually.  RTOSs are designed so as 
to maximize timing reliability and honor process priority settings, and they do this by having a very small kernel (to 
minimize non-interruptible time) and farming out as many OS tasks as possible to separate processes.

So why doesn't every OS do this?  When would an RTOS be the *wrong* platform for a particular software project?

Best,
Matt



_______________________________________________

QNX4 Community Support
http://community.qnx.com/sf/go/post58485
Re: RE: RE: So why isn't every OS real-time?  
> 
> Hi Matt,
> 
>   Here is a couple of links you can read that might help you out ... 
> 
>     - http://en.wikipedia.org/wiki/Real-time_operating_system 

I read this before posting, it didn't answer my question.  Looking again I see that GPOS's don't allow user programs to 
disable interrupts, which might be a good idea in many cases, but is that it?

>     - http://en.wikipedia.org/wiki/Kernel_%28computing%29 
> 
>   Please note that there are many factors companies use to make a decision as 
> to what is the most appropriate OS for their particular software project 
> including:
>      - Standards (for example, POSIX to ensure portability)
>      - Certifications (for example, a project may have a requirement for SIL 3
>  certification for safety or EAL 4+ for security )
>      - Hardware Support (possibly multicore support)
>      - Software Ecosystem (for example, a project may need a database or a 
> specialized industrial protocol)
>      - Scalability, reliability, performance (based on project requirements)
>      - Real time constraints
>      - Overall OS architecture
>      - Tools
>      - Vendor reputation
>      - Support options
>      - Costs (including licensing costs and engineering costs)
>      - Licensing terms / IP issues (Linux comes with viral GPL licensing 
> constraints)
> 
> You can only determine what the best solution is for your project by 
> evaluating a good subset of these factors. 
> 
> Cheers,
> 
> Léo
> 
> -----Original Message-----
> From: Matthew Phillips [mailto:community-noreply@qnx.com] 
> Sent: July 5, 2010 11:56 AM
> To: qnx4-community
> Subject: Re: RE: So why isn't every OS real-time?
> 
> Hello,
> 
> Thanks, that was really useful, but I couldn't find an answer to my question 
> in it actually.  RTOSs are designed so as to maximize timing reliability and 
> honor process priority settings, and they do this by having a very small 
> kernel (to minimize non-interruptible time) and farming out as many OS tasks 
> as possible to separate processes.
> 
> So why doesn't every OS do this?  When would an RTOS be the *wrong* platform 
> for a particular software project?
> 
> Best,
> Matt
> 
> 
> 
> _______________________________________________
> 
> QNX4 Community Support
> http://community.qnx.com/sf/go/post58485


Re: RE: RE: So why isn't every OS real-time?  
Real-time is a rather vague term which people interpret different and use in different contexts.

I think an important part of real-time, is the OS's scheduler. For example, qnx has a hard real-time priority preemption
 based scheduler. Where as most other operating systems implement a form of fair share scheduling. This allows high 
priority application thread's to preempt other low priority threads with minimal scheduling latency. It can also consume
 as many CPU cycles required to complete it's task without having to content for CPU with other theads in the system. 

To supplement and take advantage of the scheduler, we implement several mechanism which deals with floating and 
inherited priorities  which allows high priority tasks which may involve several processes to operate in such a way that
 can allow it to be completed in the most efficient sequence. So effectually "tasks" which don't need to be isolate to a
 particular thread can have the requester's priority propagated transparently to other threads for as long as needed to 
complete the task.

There's also a large number of mechanisms which help to prevent priority inversion and allows smart decisions to be 
taken without application developers having to solve them manually.

I'm not a kernel developers, and these are just a couple points off the top of my head. So to summarize, I think real-
time is more then just interrupt service routine latency, it's also thread preemption latency, and also more generally 
the ability to complete tasks which may include several threads, and possibly several processes a quickly as possible.  

RE: RE: RE: So why isn't every OS real-time?  
Hi Matt,

Another thing to consider is that there's no free lunch.  Real-time scheduling allows time-critical tasks to respond as 
quickly as possible to external events (usually signaled via interrupts), but that scheduling can come at a price to 
other tasks.  Tasks which are less time-critical may be interrupted more frequently and partially "starved" for CPU time
, thus causing them to take a longer time (in wall-clock terms) to finish whatever they're doing.  Depending on the 
characteristics of the real-time tasks and the overall mix of work to be done, a real-time OS may spend somewhat more of
 the total available CPU time making scheduling decisions.  This is raw overhead in the operating system itself, thus it
 is CPU time that is unavailable to *any* application tasks.  It's like a CPU-cycle "tax" that you have pay for real-
time response.

In contrast, for something like a database server, what you probably want is maximum throughput.  You want your 
application to finish its query or sort or whatever as quickly as possible.  You want as little OS overhead as possible.
  So once a given task (e.g. your database server) has the CPU, you want it to keep the CPU and be interrupted as 
infrequently as possible.  You don't want the OS wasting time _thinking_ about which task to run next, you want the OS 
to give each task the maximum amount of CPU time possible while remaining fair.

Another way to look at is that your CPU hardware runs at some fixed speed X.  You can run a real-time OS on your CPU, or
 a desktop-tuned OS, or a server-tuned OS, or whatever.  None of those OS choices make the hardware itself any faster or
 slower.  Your particular OS choice merely makes different tradeoffs for how to utilize that raw speed X.


Cheers!

Walt


-----Original Message-----
From: Matthew Phillips [mailto:community-noreply@qnx.com] 
Sent: Monday, July 05, 2010 6:08 PM
To: qnx4-community
Subject: Re: RE: RE: So why isn't every OS real-time?

> 
> Hi Matt,
> 
>   Here is a couple of links you can read that might help you out ... 
> 
>     - http://en.wikipedia.org/wiki/Real-time_operating_system 

I read this before posting, it didn't answer my question.  Looking again I see that GPOS's don't allow user programs to 
disable interrupts, which might be a good idea in many cases, but is that it?

>     - http://en.wikipedia.org/wiki/Kernel_%28computing%29 
> 
>   Please note that there are many factors companies use to make a decision as 
> to what is the most appropriate OS for their particular software project 
> including:
>      - Standards (for example, POSIX to ensure portability)
>      - Certifications (for example, a project may have a requirement for SIL 3
>  certification for safety or EAL 4+ for security )
>      - Hardware Support (possibly multicore support)
>      - Software Ecosystem (for example, a project may need a database or a 
> specialized industrial protocol)
>      - Scalability, reliability, performance (based on project requirements)
>      - Real time constraints
>      - Overall OS architecture
>      - Tools
>      - Vendor reputation
>      - Support options
>      - Costs (including licensing costs and engineering costs)
>      - Licensing terms / IP issues (Linux comes with viral GPL licensing 
> constraints)
> 
> You can only determine what the best solution is for your project by 
> evaluating a good subset of these factors. 
> 
> Cheers,
> 
> Léo
> 
> -----Original Message-----
> From: Matthew Phillips [mailto:community-noreply@qnx.com] 
> Sent: July 5, 2010 11:56 AM
> To: qnx4-community
> Subject: Re: RE: So why isn't every OS real-time?
> 
> Hello,
> 
> Thanks, that was really useful, but I couldn't find an answer to my question 
> in it actually.  RTOSs are designed so as to maximize timing reliability and 
>...
View Full Message