Re: threads and kernel

vibi <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <1193118811.2731.18.camel@root>
On Tue, 2007-10-23 at 07:14 +0200, Steve Graegert wrote:
> On 10/23/07, vibi <[email protected]> wrote:
> >  > "The init code used to set up the main program doesn't care about threads,
> >
> >  because it assumes that they won't be used anyway."
> >
> > when is init code linked to the program ,during the compile time or
> > during the run time?
> 
> It's being added by the linker at compile time.
> 
> 	\Steve

the application you gave earlier is linked without any knowledge of
multi-threading
so 

> cc test.c
> ./a.out

would fail

but you also said 

> cc test.c
> LD_PRELOAD=/usr/lib/libpthread.so ./a.out

will not fail

in both the cases same init code is added at compile time and you also
said that init code determines whether a program is multi-threaded.

So i am a little bit confused because how at run time the init code is
changed.

regards
vibi sreenivasan

> 
> Steve Grägert
> DigitalEther.de
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.