samba code query
tridge at samba.org
Tue Mar 20 06:02:51 GMT 2001
> I have a query regarding the C Samba source code.
> Why is the code "process based" and not multi-threaded ? Is it
> possible to make it multi-threaded instead of process based (i.e. is a great
> deal of
> effort required to do the same ?).
This has been widely discussed before on this list. For a full
discussion see the archives.
A summary of why threading would be a very bad idea is this:
- on most OSes (Linux is the exception) the security context is a
process property not a thread property
- to avoid races SMB security must be done via setting the OS security
context (ie. seteuid, setegid and setgroups).
Think about those two facts and you will realise why threading smbd
would be terrible.
For nmbd threading would be OK, but would really win us anything over
the current design and would be less portable.
PS: Lets hope this thread ends here :)
More information about the samba-technical