comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen.adalog@wanadoo.fr>
Subject: Re: gcov in multithreaded applications
Date: Thu, 31 Aug 2000 23:58:04 +0200
Date: 2000-09-01T07:46:42+00:00	[thread overview]
Message-ID: <8onmt2$p2r$1@wanadoo.fr> (raw)
In-Reply-To: 8oip2j$ut0$1@nnrp1.deja.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]


<daelen@my-deja.com> a �crit dans le message news: 8oip2j$ut0$1@nnrp1.deja.com...
> I am working with Gnat 3.13a on Windows NT 4.0.
>
> I would like to use gcov to profile our application containing several
> tasks.
> The problem is that the da-files are written when the application exits,
> but because most tasks contain infinit loops, the main program will not
> exit.
> I tried Win32.Winbase.ExitProcess but no da-files are written then.
>
> - so how to write intermediate profiling info to the da-files without
> having to exit the application.
> - or how to exit or terminate the application in such a way that the da-
> files are written.
> Note that aborting the tasks is not an option because not all tasks-
> names are known or in scope.
>
Yes it is. There is a very simple way to abort all tasks in a system.
In the main procedure (or some library package) have:
   Anonymous_Task : constant Task_ID := Current_Task;

and then:
   Abort_Task (Anonymous_Task);

(of course, you need to with Ada.Task_Identification). Since the main program is executed by the anonymous task, and since all tasks
have (directly or indirectly) the anonymous task as one of their masters, this is guaranteed to kill everything. Have a look at
package Debug from Adalog's component page (http://pro.wanadoo.fr/adalog/compo2.htm) for more details on that kind of techniques.

--
---------------------------------------------------------
           J-P. Rosen (Rosen.Adalog@wanadoo.fr)
Visit Adalog's web site at http://pro.wanadoo.fr/adalog





  parent reply	other threads:[~2000-08-31 21:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-30  0:00 gcov in multithreaded applications daelen
2000-08-30  0:00 ` Robert A Duff
2000-08-31 21:58 ` Jean-Pierre Rosen [this message]
2000-09-07 23:44 ` Dr Adrian Wrigley
replies disabled

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