Coder Social home page Coder Social logo

Preemptive scheduler about simba HOT 8 CLOSED

eerimoq avatar eerimoq commented on July 20, 2024
Preemptive scheduler

from simba.

Comments (8)

eerimoq avatar eerimoq commented on July 20, 2024

A preemptive scheduler was implemtented for ARM in this commit: fd7cc90

AVR and ESP ports to come. The ESP port wont make much sense since Simba is running as a FreeRTOS thread.

from simba.

eerimoq avatar eerimoq commented on July 20, 2024

Implemented on AVR. Will not implement on ESP.

from simba.

eerimoq avatar eerimoq commented on July 20, 2024

The ARM port does not work when rescheduling from the UART interrupt.

from simba.

eerimoq avatar eerimoq commented on July 20, 2024

Next attempt of the ARM preemptive scheduler looks promising. All tests pass. Closing this issue for now.

from simba.

rahuldeo2047 avatar rahuldeo2047 commented on July 20, 2024

Hi @eerimoq,
I want to understand ESP8266/32 can't have preemptive scheduler ports in simba framework. I believe esp rtos supports it.

The ESP port won't make much sense since Simba is running as a FreeRTOS thread.
Implemented on AVR. Will not implement on ESP.

:(

Is current cooperative scheduler enough for applications using
sync, inet ( wifi, socket, tcp, data size 512B/32B ), i2c, gpio, pwm together
with 5 ms deadline with precision and repeatability?
Except for wifi and main-print, rest finishes within <<5 ms individually. However, still to profile. 5 ms can go up as the bottleneck is wifi-tx-rx-tcp. I can go till 30 - 40 ms with deterministic repeatability.

This is just an understanding request. And surely not criticizing why esp is not having the preemptive scheduler.

Currently, my application is not able to tx i2c collected data over tcp in targetted time.
I am doing following things currently but not limited to:

  1. main print / shell use -> thrd_respawn total 3
  2. i2c thrd -> bus -> main and wifi
  3. bus -> wifi thrd -> tcp tx -> tcp rx -> bus -> main / * and control * /
  4. / * bus -> control thrd -> bus -> main and wifi * /

The jitter I am getting is about +/- 30 ms from x ms cycle. Sometimes it goes beyond 3 seconds as well. Maybe something to do with NO_DELAY kind of things in ESP end. Although, the host code can have performance issues.

The expectation from the application might be unrealistic. However, I want to push it.

Reference:
PassionForRobotics/ATOM_DRONE@bbcdcb8 / ISSUE_#16/ros/rosatom and rahuldeo2047/ESP_rtos_eval@e7a5c09 / ISSUE_#5/simba/i2c/sensors

If possible please let me know further steps, in case it is in context of simba repo.

Thank you

from simba.

eerimoq avatar eerimoq commented on July 20, 2024

I doubt that the ESP port will ever be deterministic. I would expect a lot of jitter, unfortunately. =/

from simba.

rahuldeo2047 avatar rahuldeo2047 commented on July 20, 2024

What could be the reasons for jitters? Is it somehow due to the soc, Simba framework itself or something else. Hope to learn or get some direction towards this issue. :)

from simba.

eerimoq avatar eerimoq commented on July 20, 2024

Likely the WiFi stack will introduce some jitter for example. I have not tested this, so it's my best guess.

from simba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.