Re: Task Management



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
.



Relevant Pages

  • Re: Extending discriminant types
    ... Because the poster states that he can compiler the code. ... I used Gnat 3.15p using Ada 95 specs. ... type Child is new KBase with null record; ...
    (comp.lang.ada)
  • Re: GNAT GPL 2005 Edition is now available
    ... I oppose Debian moving to any Ada compiler which generates ... code that has serious license restrictions. ... Why should GNAT be any different? ... Will there be *any* compilers available for Ada 2005 suitable ...
    (comp.lang.ada)
  • Re: Are there noticable differences in Ada acceptance by country?
    ... Besides Gnat, any Ada compiler is expensive, really expensive, ... multitasking, don't talk about long-term maintenance, safety, less ... Sometimes I think that a lot of beginners browse the index of any Ada ...
    (comp.lang.ada)
  • Re: How do I go about creating a minimal GNAT runtime?
    ... Well Ada has a set of rules, ... Adacore to see if the GNAT PRO series contain those libraries. ... As for the 64k RTL, ...
    (comp.lang.ada)
  • Re: ada compiler?
    ... Not a simple command line answer which is vendor and/or version ... how many beginners first downloads a GNAT version that requires: ... Most beginners that are learning Ada just use: ... always use the standard Ada language concepts first. ...
    (comp.lang.ada)