comp.lang.ada
 help / color / mirror / Atom feed
From: ahlan.marriott@gmail.com
Subject: Re: How to kill GNAT DLL initialization?
Date: Sat, 13 Aug 2016 01:59:46 -0700 (PDT)
Date: 2016-08-13T01:59:46-07:00	[thread overview]
Message-ID: <4a0bfd30-3876-4700-9437-e58340114c9f@googlegroups.com> (raw)
In-Reply-To: <nok7cf$p74$1@gioia.aioe.org>

On Friday, 12 August 2016 12:11:30 UTC+2, Dmitry A. Kazakov  wrote:
> On 12/08/2016 09:56, ahlan.marriott@gmail.com wrote:
> 
> > I can't help but feel that you are going about this the wrong way.
> 
> I found the reason, in the project file the "-a" switch was specified 
> explicitly for default Binder switches. That overrode the effect of
> 
>     for Library_Auto_Init use "false";
> 
> > I don't think you should be trying to prevent initialisation.
> 
> That is the only way because my DLL uses tasking.
> 
> > If you succeed then your DLL probably won't work because things need to be initialised.
> 
> My DLL interface calls to initialization from all exported operation.
> 
> > We do all our PC programming in Ada.
> > Unfortunately not everyone is so enlightened and so we have to produce DLLs for other departments to use.
> 
> There are other reasons to use encapsulated libraries. GNU linker 
> performance becomes catastrophic with the number of libraries we have. 
> But I would prefer an ability to have accumulating library projects that 
> will produce single static or dynamic library out of multiple libraries. 
> Encapsulated GNAT run-time is not an issue to me.
> 
> > The task restriction is normally where we trip over. So I suggest
> > that  you check very carefully where your tasks are being created. They can
> > only be created as a result of being called by the DLL user not
> > automatically by the DLL.
> 
> That is a bug on GNAT's side, IMO. The problem is not only tasks but 
> also asynchronous select. If you have any, RTS will create an internal 
> task during initialization and so freeze. Possibly there are other cases 
> when Lock_RTS is called. It is Lock_RTS that causes freezing.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

Dear Dmitry,
I am glad that you managed to solve your problem.
Although I wonder what you are doing that requires you to disable the library auto init.
We don't for any of our DLLs almost all of which create and use tasks although not from the dll_Main nor during elaboration.

Bes wishes,
Ahlan

  reply	other threads:[~2016-08-13  8:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 12:51 How to kill GNAT DLL initialization? Dmitry A. Kazakov
2016-08-10 20:18 ` ahlan.marriott
2016-08-11  7:31   ` Dmitry A. Kazakov
2016-08-12  7:56     ` ahlan.marriott
2016-08-12 10:10       ` Dmitry A. Kazakov
2016-08-13  8:59         ` ahlan.marriott [this message]
2016-08-13 19:05           ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox