Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Except for 75% of the women, everyone in the whole world wants to have sex. -- Ellyn Mustard


devel / comp.lang.ada / non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

SubjectAuthor
* non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
+* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDmitry A. Kazakov
|`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDAdaMagica
| +* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDmitry A. Kazakov
| |`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDAdaMagica
| | +* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDmitry A. Kazakov
| | |`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| | | `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| | |  +* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDennis Lee Bieber
| | |  |`- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDennis Lee Bieber
| | |  `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDJ-P. Rosen
| | |   `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| | `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDRandy Brukardt
| |  +* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDdarek
| |  |`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDmitry A. Kazakov
| |  | `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDdarek
| |  `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| |   `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDJeffrey R. Carter
| |    `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| |     +* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| |     |+- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| |     |`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDJeffrey R. Carter
| |     | `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
| |     |  `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDennis Lee Bieber
| |     `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDennis Lee Bieber
| `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDAdaMagica
|  `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDNiklas Holsti
|   +- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
|   `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDAdaMagica
`* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
 `* Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDan Winslow
  `- Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMDDennis Lee Bieber

Pages:12
non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5378&group=comp.lang.ada#5378

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:a58b:: with SMTP id o133mr8245259qke.418.1623502273572; Sat, 12 Jun 2021 05:51:13 -0700 (PDT)
X-Received: by 2002:a25:4641:: with SMTP id t62mr13206861yba.253.1623502273366; Sat, 12 Jun 2021 05:51:13 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 05:51:13 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
Subject: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 12:51:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 151
 by: Dan Winslow - Sat, 12 Jun 2021 12:51 UTC

I am trying to achieve true non-preemptive tasking using gnat 2020 CE on a windows 10 environment. I have placed this in the gnat.adc file:

pragma Task_Dispatching_Policy(Non_Preemptive_FIFO_Within_Priorities);

Without this gnat.adc setting, the tasks switched back and forth a great deal, as you would expect with preemptive tasking. Putting the pragma in the gnat.adc file seemed to affect the granularity of the task switching on my test program below, in that it lengthened the time that each task executed consecutive loops, but they still switched over to each other eventually. Here is the test program:

with Ada.Text_IO; Use Ada.Text_Io;
procedure Test is

Task Type One is
End;

Task Type Two;

Task body One is
x : Integer := 0;
Begin
put_line("one");
Loop
x:=x+1;
if x > 10000000 Then
exit;
end if;
End Loop;
Put_line("Task one done, x=" & x'img);
End;

Task body Two is
x : Integer := 0;
Begin
put_line("two");
Loop
x:=x+1;
if x > 1000 Then
exit;
end if;
End Loop;
Put_line("Task two done, x=" & x'img);
End;

a : One;
B : two;
begin

Null;
End;

Here is the compile line:

gnatmake -gnat2012 -gnatX -f -g test.adb -gnatwA -I. -I.. -D obj

And here is the output:

one
two
Task two done, x= 1001
Task one done, x= 10000001

I expected the opposite, that task one would execute first, which it did, but that it would also finish first because there's no reason for it to yield to two without preemption. It looks to me like I am not actually getting non-preemptive tasking, and I would like to know why.

After some looking I found the 2012 attribute 'with CPU', and produced test code :

With System.Multiprocessors; use System.Multiprocessors;

with Ada.Text_IO; Use Ada.Text_Io;
procedure Test is

Task Type One with Cpu=>1 is
End;

Task Type Two with Cpu=> 1 is
end;

x,y : integer := 0;
limit : integer := 1000000;

Task body One is
Begin
put_line("one");
Loop
if y > 0 then
raise tasking_error;
end if;
x:=x+1;
if x > limit Then
exit;
end if;
End Loop;
Put_line("Task one done, x=" & x'img);
Exception
When others =>
put_line("task one died, x=" & x'img);
End;

Task body Two is
Begin
put_line("two");
Loop
y:=y+1;
if y > limit Then
exit;
end if;
End Loop;
Put_line("Task two done, y=" & y'img);
Exception
When others =>
put_line("task two died");
End;

a : One;
B : two;
begin
put_line(Number_Of_CPUs'img & " cpu's");
While (x < limit+1) or (y < limit+1) loop
Delay 0.0;
End Loop;
put_line("main done, x " & x'img & " y " & y'img);
End;

which produces output

one
two
24 cpu's
task one died, x= 310528
Task two done, y= 1000001
^C

(of course, I have to ctl-c out since main never finishes.)

This happens whether or not I have the scheduling pragma in gnat.adc. Does Windows just not respect processor assignment and/or the scheduling pragma?

(Sorry for no code blocks, not sure how to do that here)

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa2bpc$it8$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5380&group=comp.lang.ada#5380

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 15:11:10 +0200
Organization: Aioe.org NNTP Server
Lines: 21
Message-ID: <sa2bpc$it8$1@gioia.aioe.org>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sat, 12 Jun 2021 13:11 UTC

On 2021-06-12 14:51, Dan Winslow wrote:
> I am trying to achieve true non-preemptive tasking using gnat 2020 CE on a windows 10 environment. I have placed this in the gnat.adc file:

[...]

> This happens whether or not I have the scheduling pragma in gnat.adc. Does Windows just not respect processor assignment and/or the scheduling pragma?

AFAIK, your tasks, if mapped onto threads, must have HIGH_PRIORITY_CLASS
in order to not be preempted.


https://docs.microsoft.com/en-us/windows/win32/procthread/scheduling-priorities

Did you try to change task priorities? I would suggest that and also
looking into the process' threads while it is running to see the effect
of the pragmas on the Windows side.

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

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5382&group=comp.lang.ada#5382

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:aed:30c1:: with SMTP id 59mr8664131qtf.16.1623512638582;
Sat, 12 Jun 2021 08:43:58 -0700 (PDT)
X-Received: by 2002:a25:75d6:: with SMTP id q205mr12648434ybc.339.1623512638207;
Sat, 12 Jun 2021 08:43:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 08:43:57 -0700 (PDT)
In-Reply-To: <sa2bpc$it8$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.98.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.98.170
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 12 Jun 2021 15:43:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: AdaMagica - Sat, 12 Jun 2021 15:43 UTC

RM 9.2(3/2) does not state in which order the tasks begin to run. They are activated together, then they are put in the ready queue in some order (there is not statement about the order in thr RM in the absence of prios). So I do not see that One has to run first.
Secondly, there is no priority defined, so they both have the same prio. Since there are no dispatching points as far as I can see, I do not understand why the running task should be preempted.
I had expected the task that is the first in the ready queue runs until it is done (this is a dispatching point), then the other will get the processor.

I didn't takeinto account how the pragma changes the default scheduling scheme.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa2lhe$ig3$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5383&group=comp.lang.ada#5383

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 17:57:37 +0200
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <sa2lhe$ig3$1@gioia.aioe.org>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sat, 12 Jun 2021 15:57 UTC

On 2021-06-12 17:43, AdaMagica wrote:

> Secondly, there is no priority defined, so they both have the same prio. Since there are no dispatching points as far as I can see, I do not understand why the running task should be preempted.

Because under Windows the default priority is in the time sharing class.
As the name suggests such threads are preempted when the their quant
expires. AFAIK, even a lower priority thread can preempt a higher
priority one if both are time sharing. Time sharing priority only
influences the duration of the quant and the chances to gain the processor.

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

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<4db69f85-a3b3-48f8-a41e-8bdf196a8294n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5384&group=comp.lang.ada#5384

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:6084:: with SMTP id u126mr9132759qkb.294.1623513781602;
Sat, 12 Jun 2021 09:03:01 -0700 (PDT)
X-Received: by 2002:a25:fc1c:: with SMTP id v28mr13256590ybd.277.1623513781470;
Sat, 12 Jun 2021 09:03:01 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 09:03:01 -0700 (PDT)
In-Reply-To: <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.98.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.98.170
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4db69f85-a3b3-48f8-a41e-8bdf196a8294n@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 12 Jun 2021 16:03:01 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Sat, 12 Jun 2021 16:03 UTC

There is another importatn point. X and Y are global, and a task may update globals only at dispatching points. So taks One could infact consider Y constant within the loop. You did not specify Volatile.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5385&group=comp.lang.ada#5385

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ae9:f309:: with SMTP id p9mr9270525qkg.363.1623513930862;
Sat, 12 Jun 2021 09:05:30 -0700 (PDT)
X-Received: by 2002:a25:75d6:: with SMTP id q205mr12740919ybc.339.1623513930733;
Sat, 12 Jun 2021 09:05:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 09:05:30 -0700 (PDT)
In-Reply-To: <sa2lhe$ig3$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.98.170; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.98.170
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: christ-u...@t-online.de (AdaMagica)
Injection-Date: Sat, 12 Jun 2021 16:05:30 +0000
Content-Type: text/plain; charset="UTF-8"
 by: AdaMagica - Sat, 12 Jun 2021 16:05 UTC

Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
> Because under Windows the default priority is in the time sharing class.
> As the name suggests such threads are preempted when the their quant
> expires. AFAIK, even a lower priority thread can preempt a higher
> priority one if both are time sharing. Time sharing priority only
> influences the duration of the quant and the chances to gain the processor.

Hm OK. Is this compatible with the Ada RM?

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa2nf9$1dbi$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5386&group=comp.lang.ada#5386

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 18:30:36 +0200
Organization: Aioe.org NNTP Server
Lines: 20
Message-ID: <sa2nf9$1dbi$1@gioia.aioe.org>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org>
<1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sat, 12 Jun 2021 16:30 UTC

On 2021-06-12 18:05, AdaMagica wrote:
> Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
>> Because under Windows the default priority is in the time sharing class.
>> As the name suggests such threads are preempted when the their quant
>> expires. AFAIK, even a lower priority thread can preempt a higher
>> priority one if both are time sharing. Time sharing priority only
>> influences the duration of the quant and the chances to gain the processor.
>
> Hm OK. Is this compatible with the Ada RM?

Unless tasks are scheduled by Ada from a single thread, it is difficult
to implement without having administrative rights. I wonder if the
behavior would change should the process start elevated and/or on a real
time priority. Something like that could be a prerequisition for the
pragma to work. One should take a look on the implementation notes...

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

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<3ca448a3-73ef-48f4-a49d-9cf8fc64ccf1n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5387&group=comp.lang.ada#5387

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:7f14:: with SMTP id f20mr8818756qtk.166.1623518337840;
Sat, 12 Jun 2021 10:18:57 -0700 (PDT)
X-Received: by 2002:a5b:448:: with SMTP id s8mr13370935ybp.363.1623518337601;
Sat, 12 Jun 2021 10:18:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 10:18:57 -0700 (PDT)
In-Reply-To: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3ca448a3-73ef-48f4-a49d-9cf8fc64ccf1n@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 17:18:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sat, 12 Jun 2021 17:18 UTC

Great stuff, all, thanks. I was not counting on the order of start of the tasks. I will look into priorities and see what that does. Did not think that global non-volatile access would force a task switch, but I will look into that as well. Will post back with findings.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<d75c208f-1698-412a-b308-58964f0e26aen@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5388&group=comp.lang.ada#5388

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:6c4:: with SMTP id 187mr9622525qkg.95.1623518467986;
Sat, 12 Jun 2021 10:21:07 -0700 (PDT)
X-Received: by 2002:a25:fc1c:: with SMTP id v28mr13607526ybd.277.1623518467792;
Sat, 12 Jun 2021 10:21:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 10:21:07 -0700 (PDT)
In-Reply-To: <3ca448a3-73ef-48f4-a49d-9cf8fc64ccf1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <3ca448a3-73ef-48f4-a49d-9cf8fc64ccf1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d75c208f-1698-412a-b308-58964f0e26aen@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 17:21:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sat, 12 Jun 2021 17:21 UTC

On Saturday, June 12, 2021 at 12:18:58 PM UTC-5, Dan Winslow wrote:
> Great stuff, all, thanks. I was not counting on the order of start of the tasks. I will look into priorities and see what that does. Did not think that global non-volatile access would force a task switch, but I will look into that as well. Will post back with findings.

How does one edit a post here?

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<iikb6gFrhljU1@mid.individual.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5389&group=comp.lang.ada#5389

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: niklas.h...@tidorum.invalid (Niklas Holsti)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 21:02:56 +0300
Organization: Tidorum Ltd
Lines: 16
Message-ID: <iikb6gFrhljU1@mid.individual.net>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<4db69f85-a3b3-48f8-a41e-8bdf196a8294n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 800nW/dURDqPn4xr5kvJiAxSajkZpkYZFx7t4iq7lMdDSvPXja
Cancel-Lock: sha1:LBFhoUwElYbJ2iAZIxoIODCYDqU=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0)
Gecko/20100101 Thunderbird/78.11.0
In-Reply-To: <4db69f85-a3b3-48f8-a41e-8bdf196a8294n@googlegroups.com>
Content-Language: en-US
 by: Niklas Holsti - Sat, 12 Jun 2021 18:02 UTC

On 2021-06-12 19:03, AdaMagica wrote:
> There is another importatn point. X and Y are global, and a task may
> update globals only at dispatching points.

Updates to globals can be delayed, yes. But where in the RM does it say
that a task cannot delay updates to non-volatile globals past
dispatching points?

I haven't found any connection between dispatching points and updates to
globals in RM Annex D, where dispatching points are defined.

> So taks One could infact consider Y constant within the loop.

Yes.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<ipt9cglp48ea4o2df4brin6lq4ha787uom@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5390&group=comp.lang.ada#5390

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 12 Jun 2021 13:06:45 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 14:06:45 -0400
Organization: IISS Elusive Unicorn
Message-ID: <ipt9cglp48ea4o2df4brin6lq4ha787uom@4ax.com>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <3ca448a3-73ef-48f4-a49d-9cf8fc64ccf1n@googlegroups.com> <d75c208f-1698-412a-b308-58964f0e26aen@googlegroups.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: YES
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 21
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-PcVVI57u/O5z36AtuzYh990OfJNwe8M32+hdySQ5+J4gE7yILd1BFt40HAsI4P8qvrtbtdJ6zbAwAb6!8tM/55SPCX+MymEOc3Ae4g8dNey1N0i5wCJvCWuWtQ11dLuar3HY+hc+X9DgNLUzxDAZuEY4
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2321
 by: Dennis Lee Bieber - Sat, 12 Jun 2021 18:06 UTC

On Sat, 12 Jun 2021 10:21:07 -0700 (PDT), Dan Winslow
<dandwinslow@gmail.com> declaimed the following:

>On Saturday, June 12, 2021 at 12:18:58 PM UTC-5, Dan Winslow wrote:
>> Great stuff, all, thanks. I was not counting on the order of start of the tasks. I will look into priorities and see what that does. Did not think that global non-volatile access would force a task switch, but I will look into that as well. Will post back with findings.
>
>How does one edit a post here?

This is Usenet -- posts get distributed to multiple servers (which
somehow manage to keep threads in order; a reply can hit a server before
the original message does).

So... Once you submit a post, it is out there and nothing can be done
to it. The NNTP protocol behind Usenet does define a CANCEL operation, but
most servers ignore them (there is no authorization that the person doing
the CANCEL was the originator of the post).

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<78d187a6-2739-4ae0-b91e-acaa8438ecden@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5391&group=comp.lang.ada#5391

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:59c7:: with SMTP id n190mr10164677qkb.146.1623531003241;
Sat, 12 Jun 2021 13:50:03 -0700 (PDT)
X-Received: by 2002:a25:4009:: with SMTP id n9mr14126102yba.73.1623531003055;
Sat, 12 Jun 2021 13:50:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 13:50:02 -0700 (PDT)
In-Reply-To: <iikb6gFrhljU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<4db69f85-a3b3-48f8-a41e-8bdf196a8294n@googlegroups.com> <iikb6gFrhljU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <78d187a6-2739-4ae0-b91e-acaa8438ecden@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 20:50:03 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sat, 12 Jun 2021 20:50 UTC

On Saturday, June 12, 2021 at 1:02:58 PM UTC-5, Niklas Holsti wrote:
> On 2021-06-12 19:03, AdaMagica wrote:
> > There is another importatn point. X and Y are global, and a task may
> > update globals only at dispatching points.
> Updates to globals can be delayed, yes. But where in the RM does it say
> that a task cannot delay updates to non-volatile globals past
> dispatching points?
>
> I haven't found any connection between dispatching points and updates to
> globals in RM Annex D, where dispatching points are defined.
> > So taks One could infact consider Y constant within the loop.
> Yes.

Yes, that was my thought too, but I'm no expert. These tasks have no dispatches at all, that's the point. I expected whichever one started first to run to completion, then the other while main was pending exit (or looping, as I set up later). They were both on the same CPU, non-preemptive was set, yet they clearly task switched.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5392&group=comp.lang.ada#5392

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:8407:: with SMTP id g7mr10031714qkd.123.1623531374712;
Sat, 12 Jun 2021 13:56:14 -0700 (PDT)
X-Received: by 2002:a25:745:: with SMTP id 66mr811908ybh.363.1623531374502;
Sat, 12 Jun 2021 13:56:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 13:56:14 -0700 (PDT)
In-Reply-To: <sa2nf9$1dbi$1@gioia.aioe.org>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa2nf9$1dbi$1@gioia.aioe.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 20:56:14 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Dan Winslow - Sat, 12 Jun 2021 20:56 UTC

On Saturday, June 12, 2021 at 11:30:37 AM UTC-5, Dmitry A. Kazakov wrote:
> On 2021-06-12 18:05, AdaMagica wrote:
> > Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
> >> Because under Windows the default priority is in the time sharing class.
> >> As the name suggests such threads are preempted when the their quant
> >> expires. AFAIK, even a lower priority thread can preempt a higher
> >> priority one if both are time sharing. Time sharing priority only
> >> influences the duration of the quant and the chances to gain the processor.
> >
> > Hm OK. Is this compatible with the Ada RM?
> Unless tasks are scheduled by Ada from a single thread, it is difficult
> to implement without having administrative rights. I wonder if the
> behavior would change should the process start elevated and/or on a real
> time priority. Something like that could be a prerequisition for the
> pragma to work. One should take a look on the implementation notes...
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

run as admin made no difference.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5393&group=comp.lang.ada#5393

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:6214:b6c:: with SMTP id ey12mr11536406qvb.48.1623536496313;
Sat, 12 Jun 2021 15:21:36 -0700 (PDT)
X-Received: by 2002:a25:6d02:: with SMTP id i2mr14908251ybc.309.1623536496035;
Sat, 12 Jun 2021 15:21:36 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 12 Jun 2021 15:21:35 -0700 (PDT)
In-Reply-To: <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa2nf9$1dbi$1@gioia.aioe.org> <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sat, 12 Jun 2021 22:21:36 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sat, 12 Jun 2021 22:21 UTC

So, I am puzzled. Nothing I do makes any different whatsoever in how the little test program runs. Setting the scheduling police, setting the task individual priorities to Max_Priority, running as admin, setting pragma Locking_Policy(Ceiling_Locking), etc. Nothing stops it from this exact output (except a slight variance in the X number)

one
two
24 cpu's
task one died, x= 397682
Task two done, y= 1000001
^C

Kind of disheartening, and I'm not sure where to go next. I don't so much require a non-preemptive scheduler, but my inability to affect any behavior at all for teh tasking is really wierd, and seems like a bug of the underlying system. Anyone have any ideas? Is there some fundamental flaw in my little test program I'm missing?

,

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<ndlacg1vmcs2sv6nainh80ki8vb7kvas60@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5394&group=comp.lang.ada#5394

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 12 Jun 2021 20:24:58 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 21:24:58 -0400
Organization: IISS Elusive Unicorn
Message-ID: <ndlacg1vmcs2sv6nainh80ki8vb7kvas60@4ax.com>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com> <sa2nf9$1dbi$1@gioia.aioe.org> <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com> <3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: YES
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 23
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-M4txFdl+y3ZanBqRx5YUfmqClvDXbWH2qOWOIU9Flxc+CY8KVDA9UzEhz0W/EdqO2jr3ZT8bng7w0yg!QdoM/7dIjvmGYhzCEeGli7R9hKpz1nNUg7pPPIXDDZAQYJAOkcOUAo2So7hMOC+3wZPRrRsP
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2746
 by: Dennis Lee Bieber - Sun, 13 Jun 2021 01:24 UTC

On Sat, 12 Jun 2021 15:21:35 -0700 (PDT), Dan Winslow
<dandwinslow@gmail.com> declaimed the following:

>Kind of disheartening, and I'm not sure where to go next. I don't so much require a non-preemptive scheduler, but my inability to affect any behavior at all for teh tasking is really wierd, and seems like a bug of the underlying system. Anyone have any ideas? Is there some fundamental flaw in my little test program I'm missing?

I suspect part of the problem may be that the GNAT runtime defers to
the OS for how tasks (threads/processes) are implemented (AdaCore probably
gets a fortune for configuring a bare-bones runtime that supports tasking).
Since Windows will have a lot of time-slicing and interrupts, ANY
task/thread is subject to preemption -- and on preemption, it likely goes
to the end of any round-robin within priorities queue.

https://www.microsoftpressstore.com/articles/article.aspx?p=2233328&seqNum=7

{Interesting -- about half-way down that page it states that a preempted
thread is put on the /head/ of the queue for its priority level, so that it
can later be restarted to "finish" its time quantum}

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<lioacg9dldcc1to826tkrrrschvh6r3ctj@4ax.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5395&group=comp.lang.ada#5395

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!paganini.bofh.team!news.dns-netz.com!news.freedyn.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 12 Jun 2021 20:55:35 -0500
From: wlfr...@ix.netcom.com (Dennis Lee Bieber)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sat, 12 Jun 2021 21:55:35 -0400
Organization: IISS Elusive Unicorn
Message-ID: <lioacg9dldcc1to826tkrrrschvh6r3ctj@4ax.com>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com> <sa2nf9$1dbi$1@gioia.aioe.org> <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com> <3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com> <ndlacg1vmcs2sv6nainh80ki8vb7kvas60@4ax.com>
User-Agent: ForteAgent/8.00.32.1272
X-No-Archive: YES
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 49
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-rWT2GdVVU/XvIMw+I+xBwmGxqALJrZ85QkjmQ5/vjZMthHHDgojzzO1vtk3Z1VW2gVdVX15recaO0Lu!9m7VouLYW6wsUnc1vRA2GALCVogk82zBejjPdtZtVmcpS6xVpR+ofnfKND6I+cJ1+i3zsNft
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3135
 by: Dennis Lee Bieber - Sun, 13 Jun 2021 01:55 UTC

On Sat, 12 Jun 2021 21:24:58 -0400, Dennis Lee Bieber
<wlfraed@ix.netcom.com> declaimed the following:

> I suspect part of the problem may be that the GNAT runtime defers to
>the OS for how tasks (threads/processes) are implemented (AdaCore probably

Also see
https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/platform_specific_information.html

"""
Choosing the Scheduling Policy

When using a POSIX threads implementation, you have a choice of several
scheduling policies: SCHED_FIFO, SCHED_RR and SCHED_OTHER.
"""
Unfortunately -- POSIX threads means, I believe, pthreads library...
That is not native on Windows, just Linux and Mac... Don't know if

"""
wPOSIX

wPOSIX is a minimal POSIX binding whose goal is to help with building
cross-platforms applications. This binding is not complete though, as the
Win32 API does not provide the necessary support for all POSIX APIs.

To use the wPOSIX binding you need to use a project file, and adding a
single with_clause will give you full access to the wPOSIX binding sources
and ensure that the proper libraries are passed to the linker.

with "wposix";
project P is
for Sources use ...;
end P;

To build the application you just need to call gprbuild for the
application’s project, here p.gpr:

gprbuild p.gpr
"""

is sufficient to get POSIX threading... I don't see anything in
https://github.com/AdaCore/wposix/tree/master/src that seems specific to
threading

--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa482l$ocp$1@franka.jacob-sparre.dk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5396&group=comp.lang.ada#5396

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail
From: ran...@rrsoftware.com (Randy Brukardt)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sun, 13 Jun 2021 01:20:04 -0500
Organization: JSA Research & Innovation
Lines: 24
Message-ID: <sa482l$ocp$1@franka.jacob-sparre.dk>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
Injection-Date: Sun, 13 Jun 2021 06:20:06 -0000 (UTC)
Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226";
logging-data="24985"; mail-complaints-to="news@jacob-sparre.dk"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246
 by: Randy Brukardt - Sun, 13 Jun 2021 06:20 UTC

"AdaMagica" <christ-usch.grein@t-online.de> wrote in message
news:1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com...
> Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
>> Because under Windows the default priority is in the time sharing class.
>> As the name suggests such threads are preempted when the their quant
>> expires. AFAIK, even a lower priority thread can preempt a higher
>> priority one if both are time sharing. Time sharing priority only
>> influences the duration of the quant and the chances to gain the
>> processor.
>
> Hm OK. Is this compatible with the Ada RM?

Not really, at least in an Annex D sense. (The core doesn't require much, in
part so Ada will work on a wide variety of targets.) Pretty much everyone
has agreed to ignore the impossibility of implementing Annex D on Windows --
remember that there is an "impossible or impractical" exception in 1.1.3
which certainly applies in this case. Indeed, I suspect that it is
impossible to implement all of Annex D on any target other than a bare
machine. (One example is that there is no known implementation of EDF
scheduling even though Annex D seems to require it to be implemented.)

Randy.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<a670da34-30e1-4c36-a404-590ac9ffcbban@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5397&group=comp.lang.ada#5397

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1424:: with SMTP id k4mr11098728qkj.299.1623571490903; Sun, 13 Jun 2021 01:04:50 -0700 (PDT)
X-Received: by 2002:a25:cb48:: with SMTP id b69mr17700629ybg.173.1623571490634; Sun, 13 Jun 2021 01:04:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 13 Jun 2021 01:04:50 -0700 (PDT)
In-Reply-To: <sa482l$ocp$1@franka.jacob-sparre.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:1c00:c1d:4b00:6504:2af1:1ca4:316f; posting-account=-iT6ZQoAAAAlqBCInAc-vB6x1soT8Jhq
NNTP-Posting-Host: 2001:1c00:c1d:4b00:6504:2af1:1ca4:316f
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com> <sa482l$ocp$1@franka.jacob-sparre.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a670da34-30e1-4c36-a404-590ac9ffcbban@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: darek.ma...@gmail.com (darek)
Injection-Date: Sun, 13 Jun 2021 08:04:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 29
 by: darek - Sun, 13 Jun 2021 08:04 UTC

On Sunday, 13 June 2021 at 08:20:08 UTC+2, Randy Brukardt wrote:
> "AdaMagica" <christ-u...@t-online.de> wrote in message
> news:1d798609-8b73-4bc6...@googlegroups.com...
> > Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
> >> Because under Windows the default priority is in the time sharing class.
> >> As the name suggests such threads are preempted when the their quant
> >> expires. AFAIK, even a lower priority thread can preempt a higher
> >> priority one if both are time sharing. Time sharing priority only
> >> influences the duration of the quant and the chances to gain the
> >> processor.
> >
> > Hm OK. Is this compatible with the Ada RM?
> Not really, at least in an Annex D sense. (The core doesn't require much, in
> part so Ada will work on a wide variety of targets.) Pretty much everyone
> has agreed to ignore the impossibility of implementing Annex D on Windows --
> remember that there is an "impossible or impractical" exception in 1.1.3
> which certainly applies in this case. Indeed, I suspect that it is
> impossible to implement all of Annex D on any target other than a bare
> machine. (One example is that there is no known implementation of EDF
> scheduling even though Annex D seems to require it to be implemented.)
>
> Randy.

Hi All,
It could be useful for Ada community - a bit different (and refreshing) approach :

https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/154828/eth-47094-02.pdf

Darek

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa4i8g$10oo$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5398&group=comp.lang.ada#5398

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org.POSTED!not-for-mail
From: mail...@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sun, 13 Jun 2021 11:13:53 +0200
Organization: Aioe.org NNTP Server
Lines: 47
Message-ID: <sa4i8g$10oo$1@gioia.aioe.org>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org>
<1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa482l$ocp$1@franka.jacob-sparre.dk>
<a670da34-30e1-4c36-a404-590ac9ffcbban@googlegroups.com>
NNTP-Posting-Host: 5WHqCw2XxjHb2npjM9GYbw.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Dmitry A. Kazakov - Sun, 13 Jun 2021 09:13 UTC

On 2021-06-13 10:04, darek wrote:
> On Sunday, 13 June 2021 at 08:20:08 UTC+2, Randy Brukardt wrote:
>> "AdaMagica" <christ-u...@t-online.de> wrote in message
>> news:1d798609-8b73-4bc6...@googlegroups.com...
>>> Dmitry A. Kazakov schrieb am Samstag, 12. Juni 2021 um 17:57:39 UTC+2:
>>>> Because under Windows the default priority is in the time sharing class.
>>>> As the name suggests such threads are preempted when the their quant
>>>> expires. AFAIK, even a lower priority thread can preempt a higher
>>>> priority one if both are time sharing. Time sharing priority only
>>>> influences the duration of the quant and the chances to gain the
>>>> processor.
>>>
>>> Hm OK. Is this compatible with the Ada RM?
>> Not really, at least in an Annex D sense. (The core doesn't require much, in
>> part so Ada will work on a wide variety of targets.) Pretty much everyone
>> has agreed to ignore the impossibility of implementing Annex D on Windows --
>> remember that there is an "impossible or impractical" exception in 1.1.3
>> which certainly applies in this case. Indeed, I suspect that it is
>> impossible to implement all of Annex D on any target other than a bare
>> machine. (One example is that there is no known implementation of EDF
>> scheduling even though Annex D seems to require it to be implemented.)
>>
>> Randy.
>
>
> Hi All,
> It could be useful for Ada community - a bit different (and refreshing) approach :
>
> https://www.research-collection.ethz.ch/bitstream/handle/20.500.11850/154828/eth-47094-02.pdf

Maybe I am wrong, but it looks to me like these guys spent 30 years in a
time capsule.

What the paper describes is basically Ada 95 protected action.
"uncooperative" = protected action. [They do refer Ada once, but not its
protected objects]

The rest is musing about co-routines which are another 60 years old, or so.

Yes, I would welcome co-routines as a special form of Ada task, but of
course without explicit yielding. Obligatory explicit yielding kills
task abstraction.

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

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa4mcr$hk3$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5399&group=comp.lang.ada#5399

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ros...@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sun, 13 Jun 2021 12:24:28 +0200
Organization: Adalog
Lines: 13
Message-ID: <sa4mcr$hk3$1@dont-email.me>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org>
<1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa2nf9$1dbi$1@gioia.aioe.org>
<c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com>
<3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Jun 2021 10:24:27 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="0b3dae7d539ec12881a48f406aa15abc";
logging-data="18051"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MZ7lox9JeU2AOiQ0LG1WQ"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
Cancel-Lock: sha1:AexSeWVJ6NO6N4P5O7I6vxxEksU=
In-Reply-To: <3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com>
Content-Language: fr
 by: J-P. Rosen - Sun, 13 Jun 2021 10:24 UTC

Le 13/06/2021 à 00:21, Dan Winslow a écrit :
> So, I am puzzled. Nothing I do makes any different whatsoever in how the little test program runs.

Hmmm... Scheduling matters only if you have less CPUs than tasks. If you
have two tasks and more than two CPUs, the tasks will effectively run
concurrently, and priorities have no effect.

--
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52
https://www.adalog.fr

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5400&group=comp.lang.ada#5400

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:ac8:4f15:: with SMTP id b21mr29274qte.222.1623586015110; Sun, 13 Jun 2021 05:06:55 -0700 (PDT)
X-Received: by 2002:a25:cb48:: with SMTP id b69mr18688607ybg.173.1623586014913; Sun, 13 Jun 2021 05:06:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 13 Jun 2021 05:06:54 -0700 (PDT)
In-Reply-To: <sa482l$ocp$1@franka.jacob-sparre.dk>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com> <sa482l$ocp$1@franka.jacob-sparre.dk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sun, 13 Jun 2021 12:06:55 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 12
 by: Dan Winslow - Sun, 13 Jun 2021 12:06 UTC

> Not really, at least in an Annex D sense. (The core doesn't require much, in
> part so Ada will work on a wide variety of targets.) Pretty much everyone
> has agreed to ignore the impossibility of implementing Annex D on Windows --
> remember that there is an "impossible or impractical" exception in 1.1.3
> which certainly applies in this case. Indeed, I suspect that it is
> impossible to implement all of Annex D on any target other than a bare
> machine. (One example is that there is no known implementation of EDF
> scheduling even though Annex D seems to require it to be implemented.)
>
> Randy.

Well. You are confirming that I shouldn't expect the behavior I am looking for? How does linux do in this regard, I could use it if needed.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<6112f904-2ae8-46f6-8822-f1562ba7193en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5401&group=comp.lang.ada#5401

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a37:8407:: with SMTP id g7mr11953444qkd.123.1623586274791; Sun, 13 Jun 2021 05:11:14 -0700 (PDT)
X-Received: by 2002:a25:2b05:: with SMTP id r5mr18266192ybr.465.1623586274628; Sun, 13 Jun 2021 05:11:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!2.eu.feeder.erje.net!feeder.erje.net!news.uzoreto.com!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 13 Jun 2021 05:11:14 -0700 (PDT)
In-Reply-To: <sa4mcr$hk3$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com> <sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com> <sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com> <sa2nf9$1dbi$1@gioia.aioe.org> <c1fadbd7-3d61-4edd-a93b-756a0cd2329bn@googlegroups.com> <3b70ea2b-9783-48a3-999c-55486126ec9dn@googlegroups.com> <sa4mcr$hk3$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <6112f904-2ae8-46f6-8822-f1562ba7193en@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sun, 13 Jun 2021 12:11:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 19
 by: Dan Winslow - Sun, 13 Jun 2021 12:11 UTC

On Sunday, June 13, 2021 at 5:24:29 AM UTC-5, J-P. Rosen wrote:
> Le 13/06/2021 à 00:21, Dan Winslow a écrit :
> > So, I am puzzled. Nothing I do makes any different whatsoever in how the little test program runs.
> Hmmm... Scheduling matters only if you have less CPUs than tasks. If you
> have two tasks and more than two CPUs, the tasks will effectively run
> concurrently, and priorities have no effect.
>
> --
> J-P. Rosen
> Adalog
> 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
> Tel: +33 1 45 29 21 52
> https://www.adalog.fr

I know how multiprocessing works. I am using an Annex D facility that is supposed to set non-preemptive, and both tasks are on the same core (assuming THAT works on windows). One task should monopolize, then the next, and then main terminate.

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<sa50fc$db5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5402&group=comp.lang.ada#5402

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spam.jrc...@spam.not.acm.org (Jeffrey R. Carter)
Newsgroups: comp.lang.ada
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
Date: Sun, 13 Jun 2021 15:16:26 +0200
Organization: Also freenews.netfront.net; news.tornevall.net;
news.eternal-september.org
Lines: 21
Message-ID: <sa50fc$db5$1@dont-email.me>
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org>
<aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org>
<1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa482l$ocp$1@franka.jacob-sparre.dk>
<26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Jun 2021 13:16:28 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="b0f14bfd370aff219d898e2b43b28ef1";
logging-data="13669"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+pw4CihkaewRAaS4sgy49ZCdnhIaP5TeA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.8.1
Cancel-Lock: sha1:7B+W3XuVjlDfJEgT9jKYmOnCDYc=
In-Reply-To: <26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>
Content-Language: en-US
 by: Jeffrey R. Carter - Sun, 13 Jun 2021 13:16 UTC

On 6/13/21 2:06 PM, Dan Winslow wrote:
>
> Well. You are confirming that I shouldn't expect the behavior I am looking for? How does linux do in this regard, I could use it if needed.

with Xubuntu 21.04 and GNAT 11 I get

~/Code$ ./winslow
8 CPUs
one
Task one done, x= 1000001
two
Task two done, y= 1000001
main done, x 1000001 y 1000001

I get this with or without the scheduling pragma in gnat.adc.

--
Jeff Carter
"Don't knock masturbation. It's sex with someone I love."
Annie Hall
45

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<14166772-2507-4953-8843-57fe35b0f6fbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5403&group=comp.lang.ada#5403

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1003:: with SMTP id z3mr13251284qkj.490.1623602639713;
Sun, 13 Jun 2021 09:43:59 -0700 (PDT)
X-Received: by 2002:a25:cfc3:: with SMTP id f186mr19658105ybg.161.1623602639488;
Sun, 13 Jun 2021 09:43:59 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!usenet.pasdenom.info!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 13 Jun 2021 09:43:59 -0700 (PDT)
In-Reply-To: <sa50fc$db5$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa482l$ocp$1@franka.jacob-sparre.dk> <26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>
<sa50fc$db5$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <14166772-2507-4953-8843-57fe35b0f6fbn@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sun, 13 Jun 2021 16:43:59 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sun, 13 Jun 2021 16:43 UTC

On Sunday, June 13, 2021 at 8:16:31 AM UTC-5, Jeffrey R. Carter wrote:
> On 6/13/21 2:06 PM, Dan Winslow wrote:
> >
> > Well. You are confirming that I shouldn't expect the behavior I am looking for? How does linux do in this regard, I could use it if needed.
> with Xubuntu 21.04 and GNAT 11 I get
>
> ~/Code$ ./winslow
> 8 CPUs
> one
> Task one done, x= 1000001
> two
> Task two done, y= 1000001
> main done, x 1000001 y 1000001
>
> I get this with or without the scheduling pragma in gnat.adc.
>
> --
> Jeff Carter
> "Don't knock masturbation. It's sex with someone I love."
> Annie Hall
> 45
Yep, just found that myself. So, I guess since the tasks get mapped onto underlying os threads, windows has its own ideas and does things like automatic priority promotion and other non-compliant stuff. Too bad, but I guess kind of makes sense because windows does everything possible, most likely, to prevent any kind of thread monopolization. Would be nice if the gnat windows version at least threw a warning that 'hey, it's legal, but it aint gonna work on windows'.

So, works perfectly on linux. Probably would on windows too if I knew how to swap out for a pthreads implementation on windows.

Thanks!

Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD

<5470ede9-7036-4af7-8087-6dc8ff8f9ca0n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=5404&group=comp.lang.ada#5404

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a0c:ea4d:: with SMTP id u13mr14539127qvp.22.1623602782213;
Sun, 13 Jun 2021 09:46:22 -0700 (PDT)
X-Received: by 2002:a25:fc1c:: with SMTP id v28mr19059061ybd.277.1623602782035;
Sun, 13 Jun 2021 09:46:22 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sun, 13 Jun 2021 09:46:21 -0700 (PDT)
In-Reply-To: <14166772-2507-4953-8843-57fe35b0f6fbn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=174.71.119.33; posting-account=ix5KpAoAAAD9zo_4u1FxHVmn1uZn7U_d
NNTP-Posting-Host: 174.71.119.33
References: <c6169572-25bc-4db7-a50d-c6c8575069a4n@googlegroups.com>
<sa2bpc$it8$1@gioia.aioe.org> <aa8d1e4f-494e-4d8a-8c44-edfdb7f3ec04n@googlegroups.com>
<sa2lhe$ig3$1@gioia.aioe.org> <1d798609-8b73-4bc6-b74f-e435e8af8fedn@googlegroups.com>
<sa482l$ocp$1@franka.jacob-sparre.dk> <26182d75-4a84-47d2-b151-bbcb01964fabn@googlegroups.com>
<sa50fc$db5$1@dont-email.me> <14166772-2507-4953-8843-57fe35b0f6fbn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5470ede9-7036-4af7-8087-6dc8ff8f9ca0n@googlegroups.com>
Subject: Re: non-preemptive tasking on GNAT 2020 Windows 10 multicore AMD
From: dandwins...@gmail.com (Dan Winslow)
Injection-Date: Sun, 13 Jun 2021 16:46:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Dan Winslow - Sun, 13 Jun 2021 16:46 UTC

On Sunday, June 13, 2021 at 11:44:00 AM UTC-5, Dan Winslow wrote:
> On Sunday, June 13, 2021 at 8:16:31 AM UTC-5, Jeffrey R. Carter wrote:
> > On 6/13/21 2:06 PM, Dan Winslow wrote:
> > >
> > > Well. You are confirming that I shouldn't expect the behavior I am looking for? How does linux do in this regard, I could use it if needed.
> > with Xubuntu 21.04 and GNAT 11 I get
> >
> > ~/Code$ ./winslow
> > 8 CPUs
> > one
> > Task one done, x= 1000001
> > two
> > Task two done, y= 1000001
> > main done, x 1000001 y 1000001
> >
> > I get this with or without the scheduling pragma in gnat.adc.
> >
> > --
> > Jeff Carter
> > "Don't knock masturbation. It's sex with someone I love."
> > Annie Hall
> > 45
> Yep, just found that myself. So, I guess since the tasks get mapped onto underlying os threads, windows has its own ideas and does things like automatic priority promotion and other non-compliant stuff. Too bad, but I guess kind of makes sense because windows does everything possible, most likely, to prevent any kind of thread monopolization. Would be nice if the gnat windows version at least threw a warning that 'hey, it's legal, but it aint gonna work on windows'.
>
> So, works perfectly on linux. Probably would on windows too if I knew how to swap out for a pthreads implementation on windows.
>
> Thanks!

Odd that it doesn't require the gnat.adc pragma though. I suppose linux is counting on delay statements or other sync points to swap. For what I need, that's perfect.

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor