lkml.org 
[lkml]   [2003]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Who changed /proc/<pid>/ in 2.6.0-test5-bk9?
Date
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.162 / U:0.192 seconds]
©2003-2014 Jasper Spaans. Advertise on this site