Re: threads and kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2007-10-23 at 07:14 +0200, Steve Graegert wrote:
> On 10/23/07, vibi <vibi_sreenivasan@xxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux