Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Dec 2014 10:06:30 +0100
From:      Roland Smith <rsmith@xs4all.nl>
To:        Mayuresh Kathe <mayuresh@kathe.in>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: posix has been rendered useless, isn't it?
Message-ID:  <20141224090630.GA93154@slackbox.erewhon.home>
In-Reply-To: <20141221155635.GA1388@aio>
References:  <20141221155635.GA1388@aio>

next in thread | previous in thread | raw e-mail | index | archive | help

--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Dec 21, 2014 at 09:26:37PM +0530, Mayuresh Kathe wrote:
> hello,
>=20
> there's a question which i have not been able to
> find an answer to yet, hence venture to pose here.
>=20
> i have been studying the unix way of doing things,
> i.e. tool-chaining to combine small programs for
> accomplishing a solution.

Simple chaining is only *one* possible connection mechanism.  One
that is perfectly suitable for =E2=80=9Cfilters=E2=80=9D; programs that rea=
d from
standard input and write to standard output.  But it is not always
suitable for other types of programs.

The UNIX phylosophy is much larger than that.  Therefore I would
recommend that you read =E2=80=9CThe Art of Unix Programming=E2=80=9D by Er=
ic
Raymond.  You can read the first edition online here:
http://www.catb.org/esr/writings/taoup/html/ The section =E2=80=9CBasics
of the Unix Philosophy=E2=80=9D
http://www.catb.org/esr/writings/taoup/html/ch01s06.html is a good
overview.

> but, almost none of today's servers built for any
> of today's unix-like systems adhere to the unix
> philosophy. most of them instead, are large
> applications.

Not always.  Look e.g. at the nginx webserver or the postfix mail server.

> i couldn't find a way to write a c-shell script
> to create a workable mail server in minimal time.

That is because a mail server isn't really suitable for the =E2=80=9Cchaini=
ng=E2=80=9D
model.

The postfix mail server consists of several cooperating programs
instead of one monolithic program like sendmail.  They cooperate
by reading/writing mail queues.  Look at
http://www.postfix.org/OVERVIEW.html for an overview of the
architecture of postfix.

Another example is the nginx webserver.  This is a relatively small
program; the stripped binary on my FreeBSD 10 amd64 machine is
594656 bytes.  It has approximately 150.000 lines of code.  It uses
multiple =E2=80=9Cworker=E2=80=9D processes to make use of modern multi-cor=
e machines.
Thw workers use an event-driven architcture to achieve a high degree
of concurrency (handling many requests at one time) with a low
memory usage.  Splitting the handling of a HTTP request into many
small pieces that can individually be executed quickly allows the
program to keep being responsive to new incoming requests while
many other requests are in different stages of being handled.


Roland
--=20
R.F.Smith                                   http://rsmith.home.xs4all.nl/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 5753 3324 1661 B0FE 8D93  FCED 40F6 D5DC A38A 33E0 (keyID: A38A33E0)

--W/nzBZO5zC0uMSeA
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCAAGBQJUmoINAAoJEED21dyjijPgN10P/R7eaYWRtD+zPLC0QeLqdwkt
T8AZ/1dYV5NN+g+Rm8UhXTiRM99GF20CWYlQB9TX0LG/GykuEph5wCWBKKyFljr9
YfThUf2EmXwScFUwuk+zE1xrUhZt0GkWQYp2yjudN2/S9J83MyUT2NGoH36j4+iZ
G3w9b5WMgmimCTAv09sWqdaH+GFMQIXjgv14LCL3W5PC547lVxIxRoGZr6l9Z3xp
K2f0SSS7ObHfcna9G2tKVTqaWkVWFsIj6W83KTC/WtTHwSlZQJTdh9NVRyXq10Q3
U18cLfvRiDIFWzRHcuxkyATG+VIEQSwYgTYDBVCG3mOrwsQBFBhZr7MoWbVhra8h
L1y/37739w+snEQvTUK3WcjPdWgvPXuJWdKkfqO8pfNn/cs2OVE76qDeVsiBo5N3
W4fin0nPBGFJ4hR3y0D/QSlyOkJtD8B/OptUpwugtZ/aRZjQ28xo35Db1rXcIxlB
9+v+9ew2SUkgMz8g60XZ/BfM7rcbd8E5/+z20x8TvIhEQxk560z/O/UVpFwc6SeU
uXeATNDhVLN2JuRtUkw+YSV383W6nsiMvF5kh77jl5fTs+PZ2VpR8KbWjs7nWXcA
Lzw+y79iN3VY/sAQXu4XPEZ3SrTBns5DRwKZp/P+U3TGycNU2qQ4QCyn2Fd2J6m0
AEfrpXdAiKfWJlZ2fjtC
=EI+c
-----END PGP SIGNATURE-----

--W/nzBZO5zC0uMSeA--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141224090630.GA93154>