diff options
Diffstat (limited to 'docs/htmldocs/Samba3-Developers-Guide/architecture.html')
-rw-r--r-- | docs/htmldocs/Samba3-Developers-Guide/architecture.html | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/docs/htmldocs/Samba3-Developers-Guide/architecture.html b/docs/htmldocs/Samba3-Developers-Guide/architecture.html index 996ce8a42e..b46a9def6b 100644 --- a/docs/htmldocs/Samba3-Developers-Guide/architecture.html +++ b/docs/htmldocs/Samba3-Developers-Guide/architecture.html @@ -1,4 +1,4 @@ -<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. Samba Architecture</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="pt02.html" title="Part II. Samba Basics"><link rel="next" href="debug.html" title="Chapter 4. The samba DEBUG system"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Samba Architecture</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pt02.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="architecture"></a>Chapter 3. Samba Architecture</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Dan</span> <span class="surname">Shearer</span></h3></div></div><div><p class="pubdate"> November 1997</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="architecture.html#id2556708">Introduction</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2556751">Multithreading and Samba</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2556783">Threading smbd</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2556844">Threading nmbd</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2556889">nbmd Design</a></span></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556708"></a>Introduction</h2></div></div></div><p> +<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 3. Samba Architecture</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part II. Samba Basics"><link rel="prev" href="pt02.html" title="Part II. Samba Basics"><link rel="next" href="debug.html" title="Chapter 4. The samba DEBUG system"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Samba Architecture</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="pt02.html">Prev</a> </td><th width="60%" align="center">Part II. Samba Basics</th><td width="20%" align="right"> <a accesskey="n" href="debug.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 3. Samba Architecture"><div class="titlepage"><div><div><h2 class="title"><a name="architecture"></a>Chapter 3. Samba Architecture</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Dan</span> <span class="surname">Shearer</span></h3></div></div><div><p class="pubdate"> November 1997</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="architecture.html#id2562765">Introduction</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2562808">Multithreading and Samba</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2562839">Threading smbd</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2562900">Threading nmbd</a></span></dt><dt><span class="sect1"><a href="architecture.html#id2562945">nbmd Design</a></span></dt></dl></div><div class="sect1" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2562765"></a>Introduction</h2></div></div></div><p> This document gives a general overview of how Samba works internally. The Samba Team has tried to come up with a model which is the best possible compromise between elegance, portability, security @@ -6,10 +6,10 @@ and the constraints imposed by the very messy SMB and CIFS protocol. </p><p> It also tries to answer some of the frequently asked questions such as: -</p><div class="orderedlist"><ol type="1"><li><p> +</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> Is Samba secure when running on Unix? The xyz platform? What about the root priveliges issue? -</p></li><li><p>Pros and cons of multithreading in various parts of Samba</p></li><li><p>Why not have a separate process for name resolution, WINS, and browsing?</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556751"></a>Multithreading and Samba</h2></div></div></div><p> +</p></li><li class="listitem"><p>Pros and cons of multithreading in various parts of Samba</p></li><li class="listitem"><p>Why not have a separate process for name resolution, WINS, and browsing?</p></li></ol></div></div><div class="sect1" title="Multithreading and Samba"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2562808"></a>Multithreading and Samba</h2></div></div></div><p> People sometimes tout threads as a uniformly good thing. They are very nice in their place but are quite inappropriate for smbd. nmbd is another matter, and multi-threading it would be very nice. @@ -26,32 +26,32 @@ smbd multi-threaded. Multi-threading would actually make Samba much slower, less scalable, less portable and much less robust. The fact that we use a separate process for each connection is one of Samba's biggest advantages. -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556783"></a>Threading smbd</h2></div></div></div><p> +</p></div><div class="sect1" title="Threading smbd"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2562839"></a>Threading smbd</h2></div></div></div><p> A few problems that would arise from a threaded smbd are: -</p><div class="orderedlist"><ol type="1"><li><p> +</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> It's not only to create threads instead of processes, but you must care about all variables if they have to be thread specific (currently they would be global). -</p></li><li><p> +</p></li><li class="listitem"><p> if one thread dies (eg. a seg fault) then all threads die. We can immediately throw robustness out the window. -</p></li><li><p> +</p></li><li class="listitem"><p> many of the system calls we make are blocking. Non-blocking equivalents of many calls are either not available or are awkward (and slow) to use. So while we block in one thread all clients are waiting. Imagine if one share is a slow NFS filesystem and the others are fast, we will end up slowing all clients to the speed of NFS. -</p></li><li><p> +</p></li><li class="listitem"><p> you can't run as a different uid in different threads. This means we would have to switch uid/gid on _every_ SMB packet. It would be horrendously slow. -</p></li><li><p> +</p></li><li class="listitem"><p> the per process file descriptor limit would mean that we could only support a limited number of clients. -</p></li><li><p> +</p></li><li class="listitem"><p> we couldn't use the system locking calls as the locking context of fcntl() is a process, not a thread. -</p></li></ol></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556844"></a>Threading nmbd</h2></div></div></div><p> +</p></li></ol></div></div><div class="sect1" title="Threading nmbd"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2562900"></a>Threading nmbd</h2></div></div></div><p> This would be ideal, but gets sunk by portability requirements. </p><p> Andrew tried to write a test threads library for nmbd that used only @@ -78,7 +78,7 @@ packet that arrives. Having a pool of processes is possible but is nasty to program cleanly due to the enormous amount of shared data (in complex structures) between the processes. We can't rely on each platform having a shared memory system. -</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2556889"></a>nbmd Design</h2></div></div></div><p> +</p></div><div class="sect1" title="nbmd Design"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2562945"></a>nbmd Design</h2></div></div></div><p> Originally Andrew used recursion to simulate a multi-threaded environment, which use the stack enormously and made for really confusing debugging sessions. Luke Leighton rewrote it to use a |