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:
Advantages
- assuming that the user-threads package is cooperative, user programs do not need to be written with yields everywhere
- each thread is guaranteed a fair amount of execution time (as fair as the os is)
- 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.
- low granularity multitasking, gives the illusion of parallelism
- can take advantage of multiprocessors, as the kernel can dispatch threads to other cpus as it sees appropriate
- the user program must use locks and mutexes appropriately around critical sections, since it cannot control when context switching will occur (...but so what)
- code is less portable since this requires operating system support
- cannot choose the scheduling algorithm
- Thread management (create, delete, ect) is more expensive as it now requires system calls
0 comments:
Feel free to contact the admin for any suggestions and help.