ArticleslgStudy

computer science

Light Weight Kernel Threads

Light Weight Kernel Threads is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Light Weight Kernel Threads rather than just read about it. In short: 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.

Key takeaways

  • Light Weight Kernel Threads belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Light Weight Kernel Threads to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Light Weight Kernel Threads from memory before moving on to harder problems.

Reference excerpt

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 Light-weight process Thread (computing)

Sources Matt Dillon's post about the LWKT scheduler Kerner, Sean Michael (2006-01-10), "New DragonFly Released For BSD Users", InternetNews, retrieved 2011-11-20 Biancuzzi, Federico (2004-07-08), "Behind DragonFly BSD", O'Reilly Media, archived from the original on 2014-04-09, retrieved 2011-11-20 Loli-Queru, Eugenia (2004-03-13), "Interview with Matthew Dillon of DragonFly BSD", OSNews Luciani, Robert (2009-05-24), M:N threading in DragonflyBSD (PDF), BSDCon, archived from the original (PDF) on 2010-12-23 Andrews, Jeremy (2007-08-06), "Interview: Matthew Dillon", KernelTrap, archived from the original on 2011-05-15, retrieved 2011-11-20 Vervloesem, Koen (2010-04-21), "DragonFly BSD 2.6: towards a free clustering operating system", LWN.net, retrieved 2011-11-19 Kerner, Sean Michael (2006-07-25), "DragonFly BSD 1.6 Cuts the Cord", InternetNews, retrieved 2011-11-20 Townsend, Trent (2006-01-18), "A Quick Review of DragonFly BSD 1.4", OSNews, retrieved 2011-11-16 Interjú Matthew Dillionnal a DragonFly BSD alapítójával, 2003-10-10, retrieved 2011-11-20

Worked examples

Example 1 — a first encounter with Light Weight Kernel Threads

Start with the simplest possible case. Write down what Light Weight Kernel Threads claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Light Weight Kernel Threads before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Light Weight Kernel Threads ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Light Weight Kernel Threads

In research
Light Weight Kernel Threads appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Light Weight Kernel Threads in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Light Weight Kernel Threads is common in secondary-school and first-year university syllabi. It links to neighbouring topics DragonFly BSD, Operating system stubs, Threads (computing), so understanding it makes those chapters shorter.
In everyday life
Look for Light Weight Kernel Threads outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Light Weight Kernel Threads in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Light Weight Kernel Threads means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Light Weight Kernel Threads out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Light Weight Kernel Threads in simple terms?

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.

Why does Light Weight Kernel Threads matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Light Weight Kernel Threads?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Light Weight Kernel Threads.

Tags

  • DragonFly BSD
  • Operating system stubs
  • Threads (computing)

Keep exploring