References: <7223c73f876d31388593.1481802442@devws148.be.alcatel-lucent.com> <2755589f-ad4d-a52d-8976-72222bc2eab2@xenomai.org> From: Philippe Gerum Message-ID: <5c5ca924-e877-cd18-0bbd-cb3191e84897@xenomai.org> Date: Thu, 15 Dec 2016 18:25:23 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai] [PATCH] boilerplate: do not call xenomai_init 2 times List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ronny Meeus Cc: xenomai@xenomai.org On 12/15/2016 05:16 PM, Ronny Meeus wrote: > On Thu, Dec 15, 2016 at 3:47 PM, Philippe Gerum wrote: >> On 12/15/2016 12:47 PM, Ronny Meeus wrote: >>> bootstrap.o is linked to the application code. >>> In case the execution of the static constructors is postponed >>> in the applicaion and the auto-init feature is used, the >>> xenomai_init is called 2 times: >>> - once in the path of the wrap_main >>> - later in the context of the static constructor >>> >> >> Why do you keep the auto-init feature on, given that you already control >> the early init code by postponing the execution of the C++ ctors? I >> would rather expect something like: >> >> - build with no-auto-init >> - call xenomai_init() manually from your entry point to activate the >> Xenomai services when you see fit. >> - call the ctor init chain. > > We have a lot of applications, some of them postpone the execution of > the constructors while others dont. > We were calling the init function ourselves before, but we would like to > remove this code to keep the application code cleaner and to have less > explicit dependencies. > It may be cleaner for your app, but this is pushing the specifics of your application to the Xenomai core, making it clumsier. I mean that the intent, purpose and function of the bootstrap code is to init the system when present. Adding a hack to nullify it instead of not adding it to the app basically turns the logic upside down, for no obvious gain. > Using the auto-init has advantages as well, one of them being that the > init code of xenomai can change completely transparant for the > application code. > I genuinely don't get your point. xenomai_init() does all the inits for Xenomai, there is nothing in the bootstrap module beyond calling this routine. I still don't understand what could be the additional advantage of having the bootstrap module in, which calling xenomai_init() would not have. -- Philippe.