Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > basic doubt on shared libraries

Reply
Thread Tools

basic doubt on shared libraries

 
 
ragi
Guest
Posts: n/a
 
      08-26-2006

Hi Friends,

Could you please tell me about,

1. What a shared library in c contains
2. (.a) file extension for shared libraries.
3. Is shared libraries are reentrant.


Thanking you in advance,
ragi

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      08-26-2006
In article <(E-Mail Removed) .com>,
ragi <(E-Mail Removed)> wrote:

> Could you please tell me about,


> 1. What a shared library in c contains
> 2. (.a) file extension for shared libraries.
> 3. Is shared libraries are reentrant.


In answer to your first question: NO, all of those are off-topic
here. Shared libraries mean different things in different implementations.
As in a newsgroup more specific to your implementation.
--
Prototypes are supertypes of their clones. -- maplesoft
 
Reply With Quote
 
 
 
 
hzmonte@hotmail.com
Guest
Posts: n/a
 
      08-27-2006
There is a wikipedia entry for Library which explains shared libraries:
http://en.wikipedia.org/wiki/Library_(computer_science)
I may be wrong, but I think whether a library (function) is reentrant
or not depends on how you code it. You can use some non-reentrant
system call or library function in your library, and then your library
becomes non-reentrant. If you use reentrant system calls or functions
in your library, then your library is reentrant. Actually, I think it
is more correct to say whether a function, rather than a library, is
reentrant. Some functions in a library may be reentrant, whereas
others in the same library are non-reentrant.

 
Reply With Quote
 
Gordon Burditt
Guest
Posts: n/a
 
      08-27-2006
>There is a wikipedia entry for Library which explains shared libraries:
>http://en.wikipedia.org/wiki/Library_(computer_science)
>I may be wrong, but I think whether a library (function) is reentrant
>or not depends on how you code it.


True, it's possible to make a function non-reentrant unnecessarily
by poor cooding.

However, some functions, like strtok() as defined by Standard C,
cannot be made reentrant and still conform to the requirements for
the function. You can sometimes add an argument that points to
storage that holds state for the function to make it reentrant, but
then it no longer has the same function signature required. It's
now a different function and it needs a different name.

>You can use some non-reentrant
>system call or library function in your library, and then your library
>becomes non-reentrant.
>If you use reentrant system calls or functions
>in your library, then your library is reentrant. Actually, I think it
>is more correct to say whether a function, rather than a library, is
>reentrant.


A reasonable definition of a "reentrant library" would seem to be:
A library is reentrant if and only if all of the functions in it
are reentrant.

>Some functions in a library may be reentrant, whereas
>others in the same library are non-reentrant.


It is sometimes the case that a non-reentrant initialization function
must be called before any of the other functions are used, and that
the reentrant functions use a number of "write-once" variables set
by the initialization function (for example, loading locale-specific
messages for the appropriate language). This would make the library
non-reentrant even if there is no explicit call to the initialization
function since the shared library mechanism automatically calls it.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dotnet doubt can any body clarify my doubt challa462@gmail.com ASP .Net 0 08-22-2012 06:02 AM
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
Using mandatory libraries (custom class loading vs. expanding libraries) Karsten Wutzke Java 21 06-29-2007 09:25 PM
doubt about doubt Bob Nelson C Programming 11 07-30-2006 08:17 PM
Shared libraries on dotnet Tascien ASP .Net 1 07-24-2004 02:59 AM



Advertisments