linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: vibi <vibi_sreenivasan@cms.com>
To: Steve Graegert <graegerts@gmail.com>
Cc: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: threads and kernel
Date: Tue, 23 Oct 2007 11:23:31 +0530	[thread overview]
Message-ID: <1193118811.2731.18.camel@root> (raw)
In-Reply-To: <6a00c8d50710222214m116cba3h31b3c7e376a5f9fb@mail.gmail.com>

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

  reply	other threads:[~2007-10-23  5:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21 13:21 threads and kernel Shriramana Sharma
2007-10-21 16:26 ` Irfan Habib
2007-10-21 17:23 ` Steve Graegert
2007-10-22  6:50   ` Benoit Fouet
2007-10-22 13:01     ` Steve Graegert
2007-10-22 13:27       ` Benoit Fouet
2007-10-22 13:31         ` Steve Graegert
2007-10-22 13:38           ` Benoit Fouet
2007-10-22 14:20             ` Steve Graegert
2007-10-22 14:34               ` Benoit Fouet
2007-10-23  4:32               ` vibi
2007-10-23  5:14                 ` Steve Graegert
2007-10-23  5:53                   ` vibi [this message]
2007-10-23  6:58                     ` Steve Graegert
2007-10-23  7:10                       ` vibi
2007-10-23  7:30                         ` Steve Graegert
2007-10-22  7:55   ` Shriramana Sharma
2007-10-22 13:41     ` Steve Graegert
2007-10-22 17:18     ` Glynn Clements
2007-10-21 17:36 ` Glynn Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1193118811.2731.18.camel@root \
    --to=vibi_sreenivasan@cms.com \
    --cc=graegerts@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).