Re: Who changed /proc/<pid>/ in 2.6.0-test5-bk9?

From: bill davidsen
Date: Thu Oct 09 2003 - 13:24:03 EST


In article <Pine.LNX.4.44.0310071743370.32358-100000@xxxxxxxxxxxxx>,
Linus Torvalds <torvalds@xxxxxxxx> wrote:

| The reason people use threads is that sharing the VM space has real
| advantages: it makes context switching much cheaper (fewer hw resources in
| the form of TLB usages) and it allows for much faster synchronization
| through a shared address space.
|
| But the same isn't true of file descriptors or a lot of other software-
| level abstractions. There are no inherent advantages to sharing, and in
| fact sharing just gives more opportunity for race conditions, bad
| interaction etc.

That depends on what you're doing. It can be lower cost to have threads
putting fd's on a chain to be serviced by another thread than to start
another thread to do the service and use IPC to do serialization
between threads. And abstractions like SysV message queues are
inherently shared. Sometimes there are savings to be had by sharing.

Your base point that resources shouldn't be shared needlessly is
correct, or course.
--
bill davidsen <davidsen@xxxxxxx>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/