[KLUG Programming] Pthreads problem

Peter Buxton programming@kalamazoolinux.org
Fri, 2 Jan 2004 07:00:51 -0500


Please read the first three messages (Kleen, Torvalds, Love) before
replying to me:

http://www.ussg.iu.edu/hypermail/linux/kernel/0307.1/0963.html

I'm posting while tired, and that is almost always a mistake, but...
ah, well.

On Thu, Jan 01, 2004 at 06:39:28PM -0500, Robert G. Brown was only escaped
   alone to tell thee:

> It seems odd and perhaps counterproductive that you are making a case
> for LESS abstraction where it can really help. It is probably a really
> good idea to use sysctl in production against the day that echo into
> /proc is deprecated, I wouldn't want to convert and test all that only
> when the time comes. 

Yeah, I'd hate to write a C program to convert:

net.ipv4.tcp_syncookies = 1

to 

echo 1 > /proc/sys/net/ipv4/tcp_syncookies

LESS abstraction, eh? Lack of use of sysctl will hurt my ability to use
the future netsysctl, which will emit kernel RPC calls over the network?

I have a better idea, let's:

1. Encrypt NFS traffic,
2. Code public key auth. for NFS, and
3. Enable file locking over NFS

and just fscking export /proc over this improved (to the point where
actual HUMAN BEINGS might like to use it) NFS to our master server,
shall we?

more APIs != more abstraction

Nah... why do something like creating a file-sharing protocol that JUST
DOESN'T SUCK?!

> Maybe you only intend to use it for online hacking; perhaps it's time
> to get into the habit of using sysctl there, too...

I'm very curious to know where you and Adam got this misinformation that
` echo > /proc/something ` is a menace to users everywhere. Not from
anywhere in the kernel, that's for sure -- I just grepped 2.6.

Now, for the record, let's review the difference between sysctl and
`echo > /proc/something `:

1. sysctl will work whether /proc is mounted or not.

2. (This space left intentionally blank.)

sysctl makes scripts work without modifying /etc/fstab, which is Good.
That's it.

`cat /proc/slabinfo` shows you things `sysctl -a` will not. This kind of
kernel publishing doesn't fit in current sysfs and sysctl would be
awkward and suffer from poor discovery.

sysfs will not replace proc, though it is a replacement for some
misshapened /proc features: it is entirely hardware related. Also, sysfs
is NOT writeable and, unless I am grossly misinformed, it will not be by
anything short of a kernel module. sysfs was made separate from /proc to
emphasize the HIGHLY structured nature of ALL sysfs data:

./Documentation/filesystems/sysfs.txt:

   Attributes should be ASCII text files, preferably with only one value
   per file. It is noted that it may not be efficient to contain only
   value per file, so it is socially acceptable to express an array of
   values of the same type.

   Mixing types, expressing multiple lines of data, and doing fancy
   formatting of data is heavily frowned upon. Doing these things may
   get you publically humiliated and your code rewritten without notice.


-- 
I'll torture you so slowly you'll think it's
a career. -- Darwin Mayflower, _Hudson Hawk_