I've read through a few RTOS articles and tutorials (like the one on FreeRTOS' site) and I still have a few questions about RTOS. Let's say we're using a preemptive RTOS for these set of questions: 1. Let's say we have two tasks, A and B, as follows: void a() { while(1) {} } void b() { while(1) {} } If task A has higher priority than B, will B ever get a chance to run? If so, how often? How about when A is set to the highest priority and B to a low priority? How is CPU time split up in that case? If task A has equal priority as task B, will CPU time be shared equally among the tasks? 2. Let's say we have two tasks, C and D, as follows: void c() { while(1) { if(some condition that is true sometimes) return; (or yield) } } void d() { while(1) {} } If C and D have equal priorities, and c returns prematurely, does D immediately get the rest of C's CPU time? Or does the IDLE task take over for C's share of the CPU time/ Is there such thing as "yield()" in a preemptive scheduler system? I mean, let's say we have a task that performs lengty floating point math trig functions. And during a certain cycle, we don't need to perform those math operations because a certain condition has been met. Can we "yield()" out of the task so that task D will get the rest of our CPU time? Let's say we add another task, E, which has less priority than C and D. If we are able to yield() out of task C, how is the rest of C's time split among D and E? 3. Are tasks generally run over and over again? Or are they just run once? 4. Is there such thing as "realtime" priority? If so, what does it mean? I've heard the term being used in the past. 5. If we have two tasks, J and K, which each perform very important protocol operations (such as bitbang 1-wire and RS-485 protocol), and both are set to the highest priority, how should they be set up so that they don't interrupt each other in critical moments, such as when task K has a job of sending a token while J is reading a temperature sensor? -- [ solarwind ] -- http://solar-blogg.blogspot.com/ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist