This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: priority of main thread


Robert Brusa wrote:
> On Thu, 20 Nov 2008 16:34:18 +0100, Gary Thomas <gary@mlbassoc.com> wrote:
> 
>> How is main() getting started?  Since you've overridden the
>> default cyg_user_start() [which normally starts the main thread],
>> it's not clear to me how main() even runs.
>>
> 
> If there is anywhere a main in a project, it gets started - but after
> cyg_user_start. That's what I have read in the manual and somewhere I
> have read that a main is required when one uses some (which?) standard
> libraries that need initialisation. Because I use math and other
> libraries, I decided to have a main in my code. May be its not
> necessary, but it should do no harm (I hope).

Actually, main() is started by cyg_user_startup().  Look at
  .../language/c/libc/startup/current/src/cstartup.cxx


-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]