Friday, September 27, 2019

Real Time Operating Systems

A real time operating system (RTOS) guarantees that a user defined task will always take the same amount of time (determinism), there won't be surprise OS tasks interrupting and delaying the user task. The RTOS scheduler takes only task priorities into account, duration is the responsibility of the developer. If a task takes too long, you have two options: Simplify the task or use better hardware.

When dealing with low resource embedded systems, the OS should also be lightweight.

Using a kernel or OS ported to your target hardware liberates you from knowing the details of the hardware and writing device drivers.

Consider Windows: It might have higher priority tasks than yours which will cause your task to vary in duration at every run and it is not light weight. These are the reasons why Windows can't be used in low resource systems with real time constraints. See this StackOverflow post.

If you know basic kernel concepts like task scheduling, you don't need to know anything extra to understand an RTOS. For a good RTOS intro, see
  • Real Time Application Design Tutorial
    • Tasks will block until an event indicates that processing is required. Events can either be external (such as a key being pressed), or internal (such as a timer expiring). This event driven approach means that no CPU time is wasted polling for events that have not occurred. Priorities are allocated to tasks in accordance to their timing requirements. The stricter the timing requirement the higher the priority... The kernel will immediately suspend an executing task should a higher priority task become available... The kernel tick frequency should be set at the slowest value that provides the required time granularity.
  • Getting Started with Micrium OS.

Wednesday, September 18, 2019

Future Work

The following strike me as topics for research that would be realistic and could have enormous consequences:
  • Blockchain: Faster but still secure consensus mechanism to improve transaction bandwidth.
  • AI, object recognition: Statistical metric to assess quality of negative images to reduce time consuming trial and error. 

Tuesday, September 17, 2019

Why do we have different electoral systems?

Why do we sometimes have top down and other times bottom up elections? Examples:
  • Top down: During presidential elections people vote for the president and the parliament. After the election, the president appoints people to top jobs.
  • Bottom up: During worker's union elections workers vote for their representatives. The representatives vote for the union president (bottom up).
Do these election types have any logic depending on their context or are they a result of historical accidents?