Is cooperative OS can be considered as a RTOS? If no why OSA operating system even is cooperative, it can be considered as a RTOS? (please refer to OSA / RTOS — Quick Intro — Part 1/3 (OSA / RTOS — Quick Intro — Part 1/3)) If yes why amoung the DIFFERENCE BETWEEN GPOS AND RTOS is GPOS (no real time OS) is not preemptive i.e. is cooperative ? (please refer to What is Real Time Operating System (RTOS) – Types of RTOS (What is Real Time Operating System (RTOS) – Types of RTOS))
There are multiple definitions of what a ‘RTOS’ is, based on multiple definitions of a Real Time System. The definition I tend to like is that it is a system that allows the program to design a system that can meet real time response constraints. For example, you may have a requirement to respond to a given signal in less than 1 ms, and that processing may take 100us. With a preemptive system, this can be fairly easy to meet (unless you have a number of these requirements and run out of CPU throughput) by preempting the current operation, perform the processing and respond to it. With a cooperative system, it requires that ALL tasks in the system know about this sort of requirement, and offer to let the task switch happen at least every 900us. Some consider that the fact that a low priority task can interfear with the completion of a high priority task disqualifies the system from being an RTOS, others don’t. Some operating systems make it very hard to try to acheive this, Their sceduling isn’t based on meeting deadlines, but distributing the processor based on a fairness docterine, that low priority task will always get some time, just not as much as high priority tasks.
To maintain the value of this forum as a source of help and knowledge for and about the FreeRTOS kernel please refrain from asking questions that are not directly related to the use of FreeRTOS.
Dear @Richard Barry, my question is about FreeRTOS as follows: if we set configUSE_PREEMPTION to 0, FreeRTOS will be cooperative, is in this case FreeRTOS keeps its real time characteristic ? Thank you in advance,
That depends on your definition of real time characteristics. The behavior when configUSE_PREEMPTION is set to 0 is documented, and if your application has specific real time requirements, then you need to ensure that documented behavior meets those requirements. What are your behavioral requirements?
Dear Richard Barry, thank you for your answer. I am asking in general, if FreeRTOS is cooperative, it can be used to design real time applicatoin ?
Saad, as I said in my answer, yes, IF all your tasks meet the approriate requirements to met your real time requirements. Even with preemption, you still have to put some requirements on all your tasks, as a low priority task could enter a critical section that runs too long and make your system violate your real time requirments. Using preemption tends to help with real time requiremnts, as lower priority tasks have less ways to interfear with higher priority tasks,
Dear Richard Damon, thank you If yes why amoung the DIFFERENCE BETWEEN GPOS AND RTOS is GPOS (no real time OS) is not preemptive i.e. is cooperative ? (please refer to https://www.robomart.com/blog/real-time-operating-system-rtos/)
My first comment would be that that blog is wrong (or at least somewhat oversimplifying). Windows is a general purpose OS (not really real-time) and is preemptive (between processes). In General, Real-Time requirements are easier to met with a preemptive OS, as you can start work on the time-critical operation very quickly (you just might wait for a critical section to end, rather than a cooperative scheduling point). This doesn’t mean you can’t build a real time system with a cooperative scheduler, a cooperative scheduler just means that every task need to be sure to reach a scheduling point often enough to maintain the real-time requirments. Many simple General operating systems for small machines are cooperative, because cooperative systems are simpler to write, and tasks also can become simpler, as you need to worry about sharing data a lot less. As I also said, some people don’t consider cooperative systems as being real time, as cooperative real time systems put real-time requirements even on the ‘non-real-time’ tasks (tasks that don’t themselves need to worry about real-time requirements). Even in preemptive systems, there are some requirements on these non-real-time tasks, namely they can’t have excessive critical sections, but that is a lot easier to manage and check for than making sure the allow scheduling often enough. Also cooperative systems can only provide longer real-time constraints (the longest interval between scheduling points becomes a floor to asured response time), and you don’t want to make that interval too short, or you build up too much overhead in checking the schedular.
Once again, https://sourceforge.net/p/freertos/discussion/382005/thread/4c4f0eff38/#28f6/ebb2
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.