Skip to content

Scheduling policies

C4Phone edited this page Dec 3, 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).
  11. should be renamed to execKernel() (it also blocks the parent thread)
  12. which can call exec() to create a whole new user process.
  13. makeKThread accepts argument to customize everything about this "Kernel Process" 1. Although "Kernel Process" does not have its own memmap, 2. Kernel Process's execChild process inherit its Terminal/GUI client handle. 3. Thus we utilize makeKThread when creating new Terminals/GUIs
  14. We use makeKThread to instantiate the 4 different shells on the 4 Text-mode Terminals.
  15. Because: if we use fork() to accomplish this, fork() must be able to move some program from terminal 0 to terminal 3, which is unsafe and breaks abstraction.
Clone this wiki locally