我对共享图书馆和固定图书馆装货时间有问题。
Assume that i have a executable foo.exe which used liba, libb, libc. 另外,在某个时候,机器上还有十多起可起诉的机器。
Now if the above 3 libraries were shared libraries : 1st Insance is loaded into RAM : The time taken will be time taken by main() of foo.exe to be loaded memory (assuming its negligible) + time to load liba + time to load libb + time to load libc 2nd instance is started : Now assume a second instance of this executable is run. Since all libraries are already loaded into the main memory, time taken is only for loading the main() to the memory which is negligible .
Now if the above 3 libraries were static libraries : 1st Insance is loaded into RAM : The time taken will be time taken by main() of foo.exe to be loaded memory (assuming its negligible) + time to load liba + time to load libb + time to load libc (Offcourse its now all part of the executable as a whole) 2nd instance is started : Now assume a second instance of this executable is run. Time taken will be again time taken by main() of foo.exe to be loaded memory (assuming its negligible) + time to load liba + time to load libb + time to load libc. (Since each executable cant share librareies as these are static librareies)
因此,我的结论是,随着静态图书馆的建立,装货时间将会增加。 但是,有人告诉我,共用图书馆在装船时比静态图书馆要花更多的时间,因此会出现拖延,因此共用图书馆不是一个好的选择。 如何做到这一点?