comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Task Management
Date: Wed, 28 Dec 2005 13:28:16 +0100
Date: 2005-12-28T13:28:11+01:00	[thread overview]
Message-ID: <v77jrgfe8vx2$.1gu7y2evifaur$.dlg@40tude.net> (raw)
In-Reply-To: 1135769272.690177.182630@g47g2000cwa.googlegroups.com

On 28 Dec 2005 03:27:52 -0800, The One Who Rages wrote:

> I am new to ada.

You are welcome, though the following is not Ada question.

> I am trying to develop a simple system for managing
> different(predefined) tasks.
> I need to know time consumption for each task(f.e task with id 1 used
> 213 ms of processor). Could anyone point me vision of solution?
> I can estimate of course, but it is not sattisfactying me.
> 
> I work under winXP, with gnat compiler.

See Win32 API procedure GetThreadTimes in MSDN. GNAT Ada tasks are most
likely mapped to Windows threads. Call GetCurrentThread once from a task to
identify it. The result is a pseudo handle. Use DuplicateHandle on it to
get another (true) handle to the thread. This one can be used outside it
(in another task.)

P.S. GNAT has Win32 bindings.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2005-12-28 12:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-28 11:27 Task Management The One Who Rages
2005-12-28 12:28 ` Dmitry A. Kazakov [this message]
2005-12-28 12:55   ` Martin Dowie
2005-12-28 12:33 ` Stephen Leake
2005-12-28 13:22 ` The One Who Rages
  -- strict thread matches above, loose matches on Subject: below --
1999-06-17  0:00 Task management Dale Stanbrough
1999-06-17  0:00 ` Larry Kilgallen
1999-06-17  0:00 ` Decker, Christian R
1999-06-17  0:00   ` Gerald Kasner
replies disabled

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