comp.lang.ada
 help / color / mirror / Atom feed
* Gnat 3.13p on NT - protected objects
@ 2001-06-27 17:30 Alejandro R. Mosteo
  2001-06-28  8:00 ` Peter F. Gath
  0 siblings, 1 reply; 3+ messages in thread
From: Alejandro R. Mosteo @ 2001-06-27 17:30 UTC (permalink / raw)


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

Hello all.

I'm using Gnat for a student project. I've recently learned that Gnat on 
NT doesn't change priority of threads when entering a protected call. In 
other words, the ceiling priority is not set and the thread runs at a 
lower priority that it should run.

I've looked the assembler code generated and it seems true. I'm quite 
perplexed, since I've never read nothing related in the docs, and never 
before anybody has told nothing about that.

Can someone enlighten me a bit? Exists some easy work around for this 
"feature"?

Many thanks,

�lex.

-------------------------------------------
Alejandro R. Mosteo
mailto: 402450@cepsz.unizar.uu_remove_uu.es
-------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gnat 3.13p on NT - protected objects
  2001-06-27 17:30 Gnat 3.13p on NT - protected objects Alejandro R. Mosteo
@ 2001-06-28  8:00 ` Peter F. Gath
  2001-06-30 18:13   ` Alejandro R. Mosteo
  0 siblings, 1 reply; 3+ messages in thread
From: Peter F. Gath @ 2001-06-28  8:00 UTC (permalink / raw)


Hi Alex.

We have also experienced this problem. Right now, we are using some basic
Windows NT functions to change the priority. Below is a small test
program you might want to try. It works fine for our application, and
a similar approach should be possible when you work with different
threads or tasks.

Good luck,

   Peter


8<-----------------

with Ada.Text_IO;   use Ada.Text_IO;
with win32;
with win32.winbase;

procedure Testprio is
   use type Win32.BOOL;
   check : Win32.BOOL;
begin
   put_line("Program has normal priority class now.");
   put_line("In 20 seconds, priority class will be changed...");
   delay(20.0);
   check := Win32.Winbase.SetPriorityClass(
                  win32.Winbase.GetCurrentProcess,
                  Win32.Winbase.IDLE_PRIORITY_CLASS);
   put_line("Program is running as idle process now.");
   put_line("Program is terminated in 20 seconds...");
   delay(20.0);
end Testprio;

8<-----------------

"Alejandro R. Mosteo" wrote:
> 
> Hello all.
> 
> I'm using Gnat for a student project. I've recently learned that Gnat on
> NT doesn't change priority of threads when entering a protected call. In
> other words, the ceiling priority is not set and the thread runs at a
> lower priority that it should run.
> 
> I've looked the assembler code generated and it seems true. I'm quite
> perplexed, since I've never read nothing related in the docs, and never
> before anybody has told nothing about that.
> 
> Can someone enlighten me a bit? Exists some easy work around for this
> "feature"?
> 
> Many thanks,
> 
> Álex.
> 
> -------------------------------------------
> Alejandro R. Mosteo
> mailto: 402450@cepsz.unizar.uu_remove_uu.es
> -------------------------------------------

-- 
____________________________________________________________

Peter F. Gath    University of Stuttgart
Dipl.-Ing.       Institute of Flight Mechanics and Control
                 Pfaffenwaldring 7a
                 D-70550 Stuttgart
                 Germany
                 Tel.: +49 711 - 6 85 - 66 67
                 Fax : +49 711 - 6 85 - 66 70

Email: peter.gath@ifr.uni-stuttgart.de
http://www.ifr.uni-stuttgart.de/
____________________________________________________________



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Gnat 3.13p on NT - protected objects
  2001-06-28  8:00 ` Peter F. Gath
@ 2001-06-30 18:13   ` Alejandro R. Mosteo
  0 siblings, 0 replies; 3+ messages in thread
From: Alejandro R. Mosteo @ 2001-06-30 18:13 UTC (permalink / raw)


Peter F. Gath ha escrito esto previamente:
> Hi Alex.
> 
> We have also experienced this problem. Right now, we are using some basic=
> 
> Windows NT functions to change the priority. Below is a small test
> program you might want to try. It works fine for our application, and
> a similar approach should be possible when you work with different
> threads or tasks.
> 
> Good luck,
> 
>    Peter

Many thanks, Peter. I was aware of that function and his companion 
SetThreadPriority. I think that it's the later what I need now (since I 
set the REALTIME class only once at the beginning of the application).

My problem was that I was trying to change the priority with 
Set_Priority within the protected object, which is forbidden by ARM. Now, 
I see that I can try the same with SetThreadPriority, and this 
should work. (How I don't think that at first??? Too much "Ada thinking", 
I presume: can't thing anything out of Ada).

It's still a little pain to make that calls in every service of my 
protected servers, but nothing compared with doing such calls from every 
client!

Cheers!

-------------------------------------------
Alejandro R. Mosteo
mailto: 402450@cepsz.unizar.uu_remove_uu.es
-------------------------------------------



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-06-30 18:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-27 17:30 Gnat 3.13p on NT - protected objects Alejandro R. Mosteo
2001-06-28  8:00 ` Peter F. Gath
2001-06-30 18:13   ` Alejandro R. Mosteo

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