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

bill davidsen
2003-10-09T18:22:44Z

In article <Pine.LNX.4.44.0310071743370.32358-100000@home.osdl.org>,
Linus Torvalds <torvalds@osdl.org> 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@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.