[Interest] Qt5, XCB and X11

Rutledge Shawn Shawn.Rutledge at digia.com
Tue Jul 15 13:45:59 CEST 2014


On 15 Jul 2014, at 12:42 PM, Till Oliver Knoll wrote:
> Otherwise the dynamic runtime linker would have to compare every bit of a newly to be linked library with any other library being currently in memory, in order to verify the identity of those libs.

That would be done in advance: the filesystem would be something like a git repo, fundamentally a big hashtable; so copying a new application and its set of libraries into place would involve hashing (and therefore de-duplicating) them.  Identical code blocks produce identical hashes.  A dynamic library's primary name would be its hash rather than its file path, but that's still a coarse-grained name.  Loading and linking could still be done by file path, but more securely by hash.  But it would be more direct and fine-grained to refer to individual implementations named by their individual hashes.  Then the library name no longer matters; it wouldn't even matter whether the application was built with static or dynamic linking.  You receive a package containing (in some form) everything necessary to run the application, but you only need to store the parts that are new and unknown to your own system, and can reuse any parts which you already had.  Some future processor could have a new instruction to call a function by its hash instead of by its address in memory, and maybe the MMU could help to take care of the mapping.  The down side is that hashes are bigger than pointers, so it would waste some memory if all procedure calls were done this way.  But maybe it's better to replace hashes with pointers as part of run-time linking.

>> I was thinking the solution to both problems might be some sort of deduplication by hashing, both in storage and in memory.  It could be done at a block level or at the level of individual functions.  It's probably a research project somewhere...
> 
> Interesting thought: that would probably require support by the compiler and/or linker: not only would it have to hash (exported) method/function signatures ("symbols" in general), but the entire implemenation in order to guarantee identical behavior.

Hash every class, method, struct and function.  If it has identical hash, it has identical implementation too.

Yes it's an ambitious out-of-scope topic for operating systems research, but it would eliminate this problem.




More information about the Interest mailing list