Skip to content

Scheduling policies

C4Phone edited this page Dec 12, 2015 · 8 revisions
  1. Big picture:
  2. Creating new PIDs will always block the original thread
  3. Use fork() to create new thread 1. Thus spawning new process <=> fork() then exec()/makeKThread()
  4. different from Linux because of course requirements.
  5. exec() actually creates a new Process
  6. and it's the only function to create a new user process
  7. fork() creates a new Thread
  8. this is the only way to create a new task without blocking the original one
  9. Thus, this is very useful for instantiating multiple terminals
  10. makeKThread() creates a new Kernel "Process" (A new process with a single kernel thread). makeKThread accepts argument to customize everything about this "Kernel Process"
  11. Although "Kernel Process" does not have its own memmap,
  12. Kernel Process's execChild process inherit its Terminal/GUI client handle.
  13. Thus we utilize makeKThread when creating new Terminals/GUIs

About tasklets

Just use makeKThread() in the interrupt handler.

About terminal read & blocking:

We disallow "blocking inside syscall":

We have to split all code related to "blocking" into two pieces:

"before-blocking" + "after-blocking", executed in two different interrupt handlers.

  • we can pass important variables as C++ lambda capture

About signals (draft):

  1. terminal is owned by single thread, not a whole process
  2. signal is sent between whole processes.
  3. For each process there is one thread only used to execute signal handlers.
Clone this wiki locally