Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DragonFly BSD
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Shared resources protection ==== In order to run safely on multiprocessor machines, access to shared resources (like files, data structures) must be [[serialization|serialized]] so that threads or processes do not attempt to modify the same resource at the same time. In order to prevent multiple threads from accessing or modifying a shared resource simultaneously, DragonFly employs [[critical section]]s, and serializing tokens to prevent concurrent access. While both Linux and FreeBSD 5 employ fine-grained [[Lock (computer science)|mutex]] models to achieve higher performance on [[multiprocessor]] systems, DragonFly does not.<ref name="behind-dfbsd" /> Until recently, DragonFly also employed [[spl (Unix)|spl]]s, but these were replaced with critical sections. Much of the system's core, including the ''LWKT'' subsystem, the IPI messaging subsystem and the new kernel memory allocator, are lockless, meaning that they work without using mutexes, with each process operating on a single CPU. Critical sections are used to protect against local interrupts, individually for each CPU, guaranteeing that a thread currently being executed will not be preempted.<ref name="luciani_dcbsdcon2009" /> [[Serializing tokens]] are used to prevent concurrent accesses from other CPUs and may be held simultaneously by multiple threads, ensuring that only one of those threads is running at any given time. Blocked or sleeping threads therefore do not prevent other threads from accessing the shared resource unlike a thread that is holding a mutex. Among other things, the use of serializing tokens prevents many of the situations that could result in [[deadlock (computer science)|deadlock]]s and [[priority inversion]]s when using mutexes, as well as greatly simplifying the design and implementation of a many-step procedure that would require a resource to be shared among multiple threads. The serializing token code is evolving into something quite similar to the "[[Read-copy-update]]" feature now available in Linux. Unlike Linux's current RCU implementation, DragonFly's is being implemented such that only processors competing for the same token are affected rather than all processors in the computer.<ref name="serializing token" /> DragonFly switched to multiprocessor safe [[slab allocator]], which requires neither mutexes nor blocking operations for memory assignment tasks.<ref name="slab-allocator-fbsd" /> It was eventually ported into standard C library in the userland, where it replaced FreeBSD's malloc implementation.<ref name="new-libc-malloc" />
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)