From: miloody on
Dear all:
Would someone tell me where I can find somw excellent examples which
shows me how to write system programs under linux, something like IPC,
MMap, thread and signal, etc.
I read some document about them and some simple program to show how to
use them.
But what I really want is to trace a program which combine the usages
of all of them gracefully.
BTW, is there any tool or setting which can let me read all of the
posting on this forum like gmail does. (one topic on main and the
same topics will be attached to the same mail)
I have change my setting as receiving digest everyday, but I have to
search every topic in the digest. :(

appreciate your help in advance,
miloody
From: yirgster on
> Buy the Stevens books.

2nd editions where published, obviously.

Also, there's a test suite for mmap that you can look at. Not (as of
2006) the official posix suite which mostly validates parameters, but
some other "semi-official" one. Try google.

For mmap write your own programs or modify a program that you have
that uses read/write for i/o and replace mallocs with MAP_ANON where
appropriate. My prediction: you'll learn a lot.

For the others too. You know, cut your teeth on your own mistakes.

From: miloody on
hi Ersek:
On 5月20日, 下午11時00分, "Ersek, Laszlo" <la...(a)caesar.elte.hu> wrote:
> On Thu, 20 May 2010, miloody wrote:
> > Would someone tell me where I can find somw excellent examples which
> > shows me how to write system programs under linux, something like IPC,
> > MMap, thread and signal, etc.
> > I read some document about them and some simple program to show how to
> > use them.
> > But what I really want is to trace a program which combine the usages of
> > all of them gracefully.
>
> If you want a program that combines *all* of them, then you're probably
> looking for a performance-oriented networked server that works with
> regular files (eg. FTP server, web server, torrent client etc, but
> anything in HPC, or wherever high throughput is important, might play). I
> reckon such software wouldn't be the best choice for educational purposes..
>
> Buy the Stevens books.
>
> http://kohala.com/start/
>
> One piece of art that combines (at least) mmap() with IPC is rtorrent. I
> believe it read()'s from sockets directly into mmap()'d regions. Prepare
> for a bumpy ride if you decide to read its source; rtorrent is production
> software.
>
> http://libtorrent.rakshasa.no/
>
> Unfortunately for you, the contributors of this group who could help you
> most presumably dedicate most of their time to their own proprietary
> developments. Based on what I've read here up till now, I'm convinced
> those products are excellent. You just can't peek at their source codes :)
>
> --o--
>
> Independently, since I saw promotion of proprietary products happen here
> (which I don't have a problem with -- I mention this only as my education
> in netiquette), I'll turn a blind eye on the adjective "excellent" in your
> post and dare to name these -- they might help you if you find nothing
> else:
>
> lbzip2 - threads and signals
> udp_copy2 - UDP/IPv4 and signals
> forward3 - TCP/IPv4 and signals, daemonizing, timeouts
>
> These are ridiculous from a performance-tuning point of view, but I
> strived hard to make them correct, portable, and reasonably documented.
> They are short and get stuff done (at least for me). All under the GPLv2+..
>
> ... Actually, the "connection setup" parts suck from the future-proofness
> POV; you should learn APIs that are IPv[46]-agnostic. See:
>
> http://people.redhat.com/drepper/userapi-ipv6.html
>
> (I'll start to fiddle with IPv6 once my residential ISP or my work
> environment starts to offer (or demand) IPv6.)
firt all, I have to appreciate your help so much.
Then, I think I use the wrong word, excellent.
I just want some good but not too simple program to learn the skill.
Thanks for your help,
miloody
I just want