Enumerate the advantages and disadvantages of supporting multi-threaded applications with kernel-level threads.

Following are the advantages and disadvantages of multi-threaded applications with kernel-level threads:
  1. assuming that the user-threads package is cooperative, user programs do not need to be written with yields everywhere
  2. each thread is guaranteed a fair amount of execution time (as fair as the os is)
  3. userspace programs do not require extra checking around blocking i/o to avoid it - i.e. other ready threads within the process can be scheduled if the running thread blocks on a system call or page fault.
  4. low granularity multitasking, gives the illusion of parallelism
  5. can take advantage of multiprocessors, as the kernel can dispatch threads to other cpus as it sees appropriate
  1.  the user program must use locks and mutexes appropriately around critical sections, since it cannot control when context switching will occur (...but so what)
  2. code is less portable since this requires operating system support
  3. cannot choose the scheduling algorithm
  4. Thread management (create, delete, ect) is more expensive as it now requires system calls


Feel free to contact the admin for any suggestions and help.