On Tue, Apr 18, 2006 at 02:24:49PM -0700, David Leimbach wrote:
> It certainly wouldn't have any effect on the context switch itself
> necessarily. But it might have an effect on page faults for code
> that's loaded dynamically and the swapping that would occur while
> freeing up free memory to load multiple copies of the same code or
> not. (though it's been said over and over again that physical memory
> savings of dynamic libraries rarely happens in practice.)
Well, this is Unix, so text segments are shared anyway. The point is,
you're right: it wouldn't have an effect on the context switch itself.
The person in question was just plain wrong. I tried to explain it to
him, and for a second he gave me that ``deer in the headlights'' blank
stare of non-comprehension, and then just went back to saying, ``write,
so it saves on the context switch....'' The guy was senior to me, so
we went with his idea, which introduced a new level of complexity that
was just ridiculous.
Of course, this was on a project written in C++ where each *class*
was in it's own directory. That is, the headers were in a single
directory, and the ``.cpp'' (heaven forbide we should use .cc as the
extension for our C++ source files, since, you know, most of the guys
had a Windows background) were each in their own directory. Make
was utterly defeated.
Ugh.
- Dan C.