Visit Our UNIX and Linux User Community


Shared, Static , Dynamic?


 
Thread Tools Search this Thread
Top Forums Programming Shared, Static , Dynamic?
# 1  
Old 03-22-2011
Question Shared, Static , Dynamic?

if I could compile the same source file as shared/static/dynamic what are the advantages/ disadv of each.

PS:by dynamic i am asking about usage of "dlopen". How is it particularly diff from shared libs
# 2  
Old 03-22-2011
static means it has all of the external libraries "internal" - so it never has to worry about library versions being correct. These image files are huge and use a lot of memory. Image activation takes longer and uses more resources than shared, especially in the event that the file is called inside a shell script loop, for example. Deployment of these is usually a slam-dunk

shared means it has all of the external libraries "external" - so it always has to worry about library versions being correct and opening them. These image files are small and use relatively smaller memory allocations. They load faster. Deployment can be iffy, so installation requires a full check of the versions of externale libraries.

There is advantage to dynamic, in that it allows you to specify exactly which versions of libraries to open, if you chose to do that. This also allows you to override LD_LIBRARY_PATH settings.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 03-23-2011
Quote:
Originally Posted by jim mcnamara
There is advantage to dynamic, in that it allows you to specify exactly which versions of libraries to open, if you chose to do that. This also allows you to override LD_LIBRARY_PATH settings.
Another means you can load libraries you didn't necessarily know about when the program was compiled. Someone could build an external plugin for your program and tell it about its existence in a commandline parameter for example.

Previous Thread | Next Thread
Test Your Knowledge in Computers #528
Difficulty: Medium
The Extended ASCII character set adds support for 128 additional characters (numbered 128 through 255) by adding 1 more bit (16 total).
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shared static library

Hello Please what does mean shared static library and LD-Preload? Thank you (3 Replies)
Discussion started by: chercheur857
3 Replies

2. Programming

Static and Shared Library in Makefile

I am having a devil of a time with a very simple make file. The program needs two shared and one static library. If I link the shared libraries only like below the mysql test app works ... (1 Reply)
Discussion started by: jadsys
1 Replies

3. Emergency UNIX and Linux Support

Merge Static and dynamic parts in variable declaration

Dear Unix experts Moved from "Shell Programming and Scripting " I want to define a variable which contains dynmic and static part, daynamic part is the first field. Sample of data dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423... (2 Replies)
Discussion started by: yahyaaa
2 Replies

4. Shell Programming and Scripting

Merge Static and dynamic parts in variable declaration

Dear Unix experts I want to define a variable which contains dynmic and static part, daynamic part is the first field. Sample of data dddd aaaa sssss 12345 ssss 2323 234234 4242 dddd 3223 34234 54353 ssss 24234 3434 42342 dddd rwrw 423423 werwer nawk 'BEGIN {FS=" "}{... (4 Replies)
Discussion started by: yahyaaa
4 Replies

5. Programming

Can I create a shared object by using an static lib?

for example, I have a static lib name liba.a it offers some interface such a1();a2(); but i do not have the source code of liba.a; If i would like to create a shared object, and offer the similar interface of a1 and a2; Is there a way to fulfill such requirement? thanks. (7 Replies)
Discussion started by: flost
7 Replies

6. Shell Programming and Scripting

Unix script to segregate dynamic and static content of a web application

I need to deploy a JAVA application on two separate servers: 1. Web server (IBM HTTP Web Servers (IHS)) 2. Application Server (WebSphere Application Server WAS7.0) The static content will have to be deployed and handled on Web server. These would include GIFs, HTML, CSS, etc files.... (0 Replies)
Discussion started by: chani27
0 Replies

7. UNIX for Dummies Questions & Answers

Change static ip to dynamic ip

I had just install a solaris 10 server. I set the ip address to static during installation. I want to change it to dynamic but I don't know how. Expert here please help me! (5 Replies)
Discussion started by: jimmyysk
5 Replies

8. UNIX for Advanced & Expert Users

static and shared libraries

can someone explain whether my understanding is correct lets suppose we have a program that uses library x. if x is static then the code of x will be part of our program, so if we're going to have 5 executables of our program, then each executable will have x as part of it. Also, x does not... (2 Replies)
Discussion started by: JamesByars
2 Replies

9. Solaris

Static & Dynamic IP on the same machine

Hi, I have a SUN SPARC with 2 NICs running Solaris 9. I want to configure the first NIC using static IP and the second NIC using dynamic IP (DHCP client). Anyone help me! Thanks in advanced. Tinh (2 Replies)
Discussion started by: tinhlx
2 Replies

10. Programming

differeEEK!nce between static and dynamic linking

hello, friends i would like to know what is the differnce between static library and dynamic library? How will u create them and what are there uses? (1 Reply)
Discussion started by: vijaya2006
1 Replies

Featured Tech Videos