TheLuaOSProject / Kernel

Kernel for the LuaOS operating system
GNU General Public License v3.0
36 stars 4 forks source link

Scheduler schedules once sometimes, othertimes doesn't schedule at all #31

Open Frityet opened 1 year ago

Frityet commented 1 year ago

Describe the bug The scheduler, which was introduced recently (d82913c2185522739286bf05c0cf6deb491314f5) has a major bug of which, as described in the title, the scheduler will only schedule once, or never, and seems to get blocked by one thread.

To Reproduce Steps to reproduce the behavior:

  1. Build LuaOS with more than 1 program (Userland/luaos-dev-1.rockspec has more than 1 module being built in its build.modules field)
  2. Launch LuaOS

Expected behavior All programs should share equal time active before being rescheduled

Screenshots Video demonstration

Additional context

This is most likely caused by a race condition in the scheduler, and therefore could be fixed or at least helped by #25 due to the fact it introduces Futexes to the threads