UML does this in a somewhat portable (but strange) way. Threads don't share
address spaces, as far as the OS is concerned, but the areas where the
executable is mapped in are copied to a file, those areas are mapped out, and
the files mapped shared in their place. This happens once, in the first
thread, and all subsequent threads get the executable mapped shared
automatically, even though they are separate processes and separate address
spaces from the point of view of the kernel.
So, once this is set up, a thread just makes an area read-write (or readonly)
and that mapping is private.
Jeff
-
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/