Following is a suggestion sent to Ada-Comment between the end of work on Ada 2022 and the setting up of this
comment system. In order that it doesn't get lost, I'm reposting it here.
Randy Brukardt, ARG Editor.
From: Simon Wright
Sent: Saturday, January 30, 2021 9:37 AM
!topic Specify storage size for environment task
!reference Ada 2012 RM13.3(59)
!from Simon Wright
!discussion
D.1(18) allows specification of the environment task's priority by using the Priority aspect on the main program.
This is handy for embedded code where you don't want to waste the environment task's stack space but need to run its code at a non-default priority.
For similar reasons, it would be useful to be able to specify the environment task's storage size by using the Storage_Size aspect on the main program.
Suggested changes:
In RM 13.3, change (59) to allow a subprogram.
Add (61.1), Likewise, the storage size is associated with the environment task if the aspect is specified for the main subprogram.
If needed, add a Legality Rules section, with (61.2), If the Storage_Size aspect is specified for a subprogram, the expression shall be static.
[Addendum for AdaCore: same consideration applies for Secondary_Stack_Size.]
From: Tucker Taft
Sent: Sunday, January 31, 2021 6:54 AM
Makes sense. One comment is that on many O/Ss, the main stack extends automatically (not Windows, alas), so it would be important to understand what the intent is in such an environment. Presumably you would consider the Storage_Size as a minimum, rather than a maximum.
From: Simon Wright
Sent: Monday, February 1, 2021 9:09 AM
I guess I was trying to be helpful, and proposed changes in the wrong place: better in the section starting at (65.1)?
Yes, I'd want the Storage_Size specified to be a minimum. (66/3) already says "the Storage_Size attribute of the newly created task object is at least the value of the expression" - would this cover it? In GNAT/macOS, the minimum task stack size appears to be 16384.
Following is a suggestion sent to Ada-Comment between the end of work on Ada 2022 and the setting up of this comment system. In order that it doesn't get lost, I'm reposting it here.
From: Simon Wright Sent: Saturday, January 30, 2021 9:37 AM
!topic Specify storage size for environment task !reference Ada 2012 RM13.3(59) !from Simon Wright !discussion
D.1(18) allows specification of the environment task's priority by using the Priority aspect on the main program.
This is handy for embedded code where you don't want to waste the environment task's stack space but need to run its code at a non-default priority.
For similar reasons, it would be useful to be able to specify the environment task's storage size by using the Storage_Size aspect on the main program.
Suggested changes:
In RM 13.3, change (59) to allow a subprogram.
Add (61.1), Likewise, the storage size is associated with the environment task if the aspect is specified for the main subprogram.
If needed, add a Legality Rules section, with (61.2), If the Storage_Size aspect is specified for a subprogram, the expression shall be static.
[Addendum for AdaCore: same consideration applies for Secondary_Stack_Size.]
From: Tucker Taft Sent: Sunday, January 31, 2021 6:54 AM
Makes sense. One comment is that on many O/Ss, the main stack extends automatically (not Windows, alas), so it would be important to understand what the intent is in such an environment. Presumably you would consider the Storage_Size as a minimum, rather than a maximum.
From: Simon Wright Sent: Monday, February 1, 2021 9:09 AM
I guess I was trying to be helpful, and proposed changes in the wrong place: better in the section starting at (65.1)?
Yes, I'd want the Storage_Size specified to be a minimum. (66/3) already says "the Storage_Size attribute of the newly created task object is at least the value of the expression" - would this cover it? In GNAT/macOS, the minimum task stack size appears to be 16384.