Light Weight Kernel Threads
Light Weight Kernel Threads (LWKT) is a computer science term and from DragonFly BSD in particular. LWKTs differ from normal kernel threads in that they can preempt normal kernel threads. According to Matt Dillon, DragonFlyBSD creator:
“ | The LWKT scheduler is responsible for actually running a thread. It uses a fixed priority scheme, but the fixed priorities are differentiating major subsystems, not user processes. For example, hardware interrupt threads have the highest priority, followed by software interrupts, kernel-only threads, then finally user threads. A user thread either runs at user-kernel priority (when it is actually running in the kernel, e.g. running a syscall on behalf of userland), or a user thread runs at user priority.
DragonFly does preempt, it just does it very carefully and only under particular circumstances. An LWKT interrupt thread can preempt most other threads, for example. This mimics what FreeBSD-4.x already did with its spl/run-interrupt-in-context-of-current-process mechanism. What DragonFly does *NOT* do is allow a non-interrupt kernel thread to preempt another non-interrupt kernel thread. The mainframe z/OS Operating system supports a similar mechanism, called SRB (Service Request Block). SRB's represent requests to execute a system service routine. SRB's are typically created when one address space detects an event that affects a different address space; they provide one of several mechanisms for asynchronous inter-address space communication for programs running on z/OS. An SRB is similar to a Process Control Block (PCB), in that it identifies a unit of work to the system. Unlike a PCB, an SRB cannot "own" storage areas. In a multiprocessor environment, the SRB routine, after being scheduled, can be dispatched on another processor and can run concurrently with the scheduling program. The scheduling program can continue to do other processing in parallel with the SRB routine. Only programs running in kernel mode can create an SRB. The Windows Operating System knows a similar light weight thread mechanism named "fibers". Fibers are scheduled by an application program. The port of the CICS Transaction Server to the Windows platform uses fibers, somewhat analogous to the use of "enclaves" under z/OS. In UNIX, "kernel threads" have two threads, one is the core thread, one is the user thread. |
” |
See also
Sources
- Matt Dillon's post about the LWKT scheduler
- Kerner, Sean Michael (2006-01-10), "New DragonFly Released For BSD Users", InternetNews, http://www.internetnews.com/dev-news/article.php/3576426, retrieved 2011-11-20
- Biancuzzi, Federico (2004-07-08), "Behind DragonFly BSD", O'Reilly Media, http://www.onlamp.com/pub/a/bsd/2004/07/08/dragonfly_bsd_interview.html, retrieved 2011-11-20
- Loli-Queru, Eugenia (2004-03-13), "Interview with Matthew Dillon of DragonFly BSD", OSNews, http://www.osnews.com/story.php?news_id=6338
- Luciani, Robert (2009-05-24), M:N threading in DragonflyBSD, BSDCon, archived from the original on 2010-12-23, https://web.archive.org/web/20101223004617/http://www.dcbsdcon.org/speakers/slides/luciani_dcbsdcon2009.pdf
- Andrews, Jeremy (2007-08-06), "Interview: Matthew Dillon", KernelTrap, archived from the original on 2011-05-15, https://web.archive.org/web/20110515101806/http://kerneltrap.org/node/14116, retrieved 2011-11-20
- Vervloesem, Koen (2010-04-21), "DragonFly BSD 2.6: towards a free clustering operating system", LWN.net, https://lwn.net/Articles/384200/, retrieved 2011-11-19
- Kerner, Sean Michael (2006-07-25), "DragonFly BSD 1.6 Cuts the Cord", InternetNews, http://www.internetnews.com/dev-news/article.php/3622406, retrieved 2011-11-20
- Townsend, Trent (2006-01-18), "A Quick Review of DragonFly BSD 1.4", OSNews, http://www.osnews.com/story/13352/A_Quick_Review_of_DragonFly_BSD_1_4, retrieved 2011-11-16
- Interjú Matthew Dillionnal a DragonFly BSD alapítójával, 2003-10-10, http://hup.hu/node/4512, retrieved 2011-11-20
Original source: https://en.wikipedia.org/wiki/Light Weight Kernel Threads.
Read more |