Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

To iterate is human, to recurse, divine. -- Robert Heller


devel / comp.lang.ada / Freeing access-to-task objects

SubjectAuthor
* Freeing access-to-task objectsEmmanuel Briot
+- Re: Freeing access-to-task objectsIndra Anita
`* Re: Freeing access-to-task objectsJ-P. Rosen
 +* Re: Freeing access-to-task objectsDmitry A. Kazakov
 |`- Re: Freeing access-to-task objectsBjörn Lundin
 `* Re: Freeing access-to-task objectsJeffrey R.Carter
  +- Re: Freeing access-to-task objectsEmmanuel Briot
  `* Re: Freeing access-to-task objectsStephen Leake
   +* Re: Freeing access-to-task objectsJeffrey R.Carter
   |`* Re: Freeing access-to-task objectsSimon Wright
   | `- Re: Freeing access-to-task objectsJeffrey R.Carter
   `- Re: Freeing access-to-task objectsAdaMagica

1
Freeing access-to-task objects

<b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:24d6:b0:6cd:f2d9:4a59 with SMTP id m22-20020a05620a24d600b006cdf2d94a59mr5431586qkn.457.1664532977731;
Fri, 30 Sep 2022 03:16:17 -0700 (PDT)
X-Received: by 2002:a05:620a:4083:b0:6ce:7e02:5cb8 with SMTP id
f3-20020a05620a408300b006ce7e025cb8mr5447761qko.170.1664532977550; Fri, 30
Sep 2022 03:16:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Fri, 30 Sep 2022 03:16:17 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:e0a:810:89e0:6c90:327f:8534:ca8;
posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH
NNTP-Posting-Host: 2a01:e0a:810:89e0:6c90:327f:8534:ca8
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
Subject: Freeing access-to-task objects
From: briot.emmanuel@gmail.com (Emmanuel Briot)
Injection-Date: Fri, 30 Sep 2022 10:16:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1268
 by: Emmanuel Briot - Fri, 30 Sep 2022 10:16 UTC

Please find a new blog post at:

https://deepbluecap.com/freeing-task-access-objects/

Abstract:
Freeing Ada tasks could result in accessing freed memory. This post describes the proper way of freeing access-to-task objects.

Re: Freeing access-to-task objects

<ec6128ad-4c26-45aa-abac-714f4edfe474n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:622a:1387:b0:35c:bbb2:d1d3 with SMTP id o7-20020a05622a138700b0035cbbb2d1d3mr8205887qtk.436.1664567638228;
Fri, 30 Sep 2022 12:53:58 -0700 (PDT)
X-Received: by 2002:ac8:5e52:0:b0:35d:1a18:3cdf with SMTP id
i18-20020ac85e52000000b0035d1a183cdfmr8331627qtx.240.1664567637895; Fri, 30
Sep 2022 12:53: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: Fri, 30 Sep 2022 12:53:57 -0700 (PDT)
In-Reply-To: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2409:4053:2c9a:b3d0:5436:bdb1:6510:bf04;
posting-account=zwvGeAoAAADJ3PQdLuqjS7Otxbhsxpya
NNTP-Posting-Host: 2409:4053:2c9a:b3d0:5436:bdb1:6510:bf04
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec6128ad-4c26-45aa-abac-714f4edfe474n@googlegroups.com>
Subject: Re: Freeing access-to-task objects
From: anitaindra084@gmail.com (Indra Anita)
Injection-Date: Fri, 30 Sep 2022 19:53:58 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Indra Anita - Fri, 30 Sep 2022 19:53 UTC

On Friday, September 30, 2022 at 3:46:18 PM UTC+5:30, briot.e...@gmail.com wrote:
> Please find a new blog post at:
>
> https://deepbluecap.com/freeing-task-access-objects/
>
> Abstract:
> Freeing Ada tasks could result in accessing freed memory. This post describes the proper way of freeing access-to-task objects.

<a href="https://selectgirls99.com/call-girls/Aerocity">Aerocity Escort Service</a>

The Aerocity Metro Station is located near Delhi Airport Express Line it was opened on 23 February. According to Delhi airport authority 5 lakh, people are coming here for the business purpose they are staying at ultimately house 16 luxury hotels they really need some night enjoyment at her own hotel room at near Delhi airport. We are the only one here who is serving Call Girl in Aerocity for direct room services to all five-star hotels at a very cheap price of 3000 Only. We are providing happiness and enthusiasm to 100% of customers. Goddesses are an important element of human life to fulfill ambitions.

<a href="https://selectgirls99.com/call-girls/Agra">Agra Escort Service</a>

Welcome to Agra is a city on the banks of the Yamuna river in the Indian state of Uttar Pradesh, if you are travelling to The Taj Mahal as a tourist purpose from delhi then you need to drive approximately about 210 kilometres (130 mi) from the national capital New Delhi. Call girl in agra often advertise their sexual services in small ads in magazines and via the Internet, although an intermediary advertiser. We are devoted and serious about preserving your convenience personally and properly secured and our girls are properly certified according to our company recommendations. The top-rated bustyagra call girl number and we offer to know that convenience is the key to our services so that our clients can appreciate their lifestyle quickly and certainly by sexy web series actresses at cheap prices

<a href="https://selectgirls99.com/call-girls/Ahmedabad ">Ahmedabad Escort Service</a>

Hello there sweet lovers, my name is Taniya Patel and I am a super hot 24-year-old independent call girl with a hot body and striking curves. A gorgeous brunette and a very sexy woman you can enjoy tonight.

In me, you will find culture, pleasure, discretion, and healthiness, all in a delicious lover. I guarantee you will love my treatment. I'm ideal for men of good taste and just the style of company you're looking for.

<a href="https://selectgirls99.com/call-girls/Ajmer ">Ajmer Escort Service</a>

e have the booking workplaces open for you. You can book the best Escorts in Aligarh by just clicking a fundamental call button without offering your own information to all the workplaces at a moderate expense. The estimation of my organization isn't far over the earth and is exceptionally reasonable. I can expect the imagine with your relations accomplice or divert the associations in 3 SEM. As sound, if you need a partner to share an event time or be accessible at the event, then call me and I will carry on a comparative estimation. I can satisfy a man my figure, consistent and ace dialect, rich mind and accessibility to apply all of them. I give the girl a probability to make the most of my vibe. I will make the situation, that you won't have vacillating that I need you. It is probably going to interest in escort.

<a href="https://selectgirls99.com/call-girls/Allahabad ">Allahabad Escort Service</a>

Here you are additionally ready to take the genuine sweetheart involvement in our most sultry female partners in Allahabad. These excellent ladies will assist you with getting genuine sweetheart experiences that you will always remember in your life. Our girls are really adorable, upscale, and enchanting enough to experience passionate feelings for them from the outset sight. On the off chance that you are distant from everyone else and searching for a female escort in Allahabad, at that point our escorts will be your actual escort at that phase of life. Our exquisite girls will give you the organization to go outside at any gathering, occasion, club, date, film and so on. We guarantee you that these delightful ladies are simply the most ideal choices to unwind.

<a href="https://selectgirls99.com/call-girls/Pushkar">Pushkar Escort Service</a>

Welcome into this inexpensive Pushkar Escort Service is going to be Termed delight's town. Ever since then as presently as so far Amravati is that the simplest Brits arrived right after creating a shot to the firm. It's hauled alongside stunning preferences in its tiny business openings and base. Concerning the Amravati, Harbor metropolis place stands state rock curve's portal, supposed in progress occasions for a phone by Amravati principal girls at Amravati. Buckle sanctuaries area unit command by seaward, Elephant Island that's shut. The city is lightweight however the center of this movement is the film business screen that's Hindi-dialect happens.

<a href="https://selectgirls99.com/call-girls/Ambala">Ambala Escort Service</a>

Ambala Escorts has a little bit of everything for everyone – from guys who choose Kullu Ambala to enjoy the beauty of the peaceful mountains. Cradled in a mountainous backdrop with the Beas River flowing through it, the Kullu Ambala region is a much sought-after destination and the demand for Ambala is evergreen. Situated at a height of 6260 meters above sea level, Ambala is a traveler’s paradise and India’s topmost honeymoon destination.

Are you planning to see Ambala, Himachal Pradesh for any cause like vacations, meetings, physical, relationship, hike& travel, etc? And thinking about somebody joins you like the female person to make the experience memorable and full of emotion at Ambala. So our Escort Service at Kullu should be the one and only option for complete entertainment with hot or sexual (both ) sex. Here you had a full dose of individual recreation and story in the form of sexy and strikingly gorgeous VIP model escorts. They serve as business bodyguards at Manali to join elite or hungry men like you who want somebody to think about his broken heart or sadness. These Escort Service are free 24/7 at Manali or out of this means to satiate the inner desires and sexual cravings

<a href="https://selectgirls99.com/call-girls/Amritsar">Amritsar Escort Service</a>

Welcome to Team of Escort Service Escort Service PULTIGARH AMRITSAR is thrilled to welcome you on board. we hope you’ll get amazing staff. Our Escort Service Escort Service AMRITSAR Escort Service Services and we trust you will have numerous pleasurable encounters with AMRITSAR Escorts. So unwind, pause for a moment and unquestionably take as much time as necessary to investigate this dazzling on the web boudoir! On the off chance that you have any significant inquiries, at that point please call or email.Escort Service| Escort Service PULTIGARH AMRITSAR

<a href="https://selectgirls99.com/call-girls/Andheri">Andheri Escort Service</a>

Here you can be sure that your details are shut inside the company recommendations so that you can appear complete of assurance. Our top-Escort Service in Andheri East will never expose any details of our people to members of the family, friends, or co-workers. Only they use your details to give us reviews that what more you want?. We think you know more about us but if you have any complaints, questions, or suggestions, just call us now, and we will be very grateful to know what you think. This is really important because we fulfillment ourselves to fulfill up with all our clients and creating a significant connection with them. We know that you should be very grateful for our service and we want you to return again for more. Really you will be happy/satisfied with the capital city of the Indian state to book a call girl near Andheri East for Multistorey Apartment.

<a href="https://selectgirls99.com/call-girls/Bandra">Bandra Escort Service</a>

She knows very well that how to attract and blow the mind of Bandra Escorts‘ pretty attractive and innocent face will give you something new and different.
If you want to take her to any party or occasion and want the royal and elite behavior, she is ready for it and she can treat you like a girlfriend or however you want.

<a href="https://selectgirls99.com/call-girls/Bangalore">Bangalore Escort Service</a>

Experience the fun and excitement of lovemaking with Bangalore Escort Service. Having a word with your loved ones or a meet can recharge you up completely. However, human is a social being and needs someone to satisfy its sexual cravings from time to time. These cravings can range from physical to mental to emotional. Are you looking out for someone who can help you fulfill your sexual and physical desire and let you attain a good libido? Then Escort Service in Bangalore can serve you with all the material pleasures.

<a href="https://selectgirls99.com/call-girls/Vadodara">Vadodara Escort Service</a>

She knows very well that how to attract and blow the mind of Vadodara Escorts‘ pretty attractive and innocent face will give you something new and different.
If you want to take her to any party or occasion and want the royal and elite behavior, she is ready for it and she can treat you like a girlfriend or however you want.

<a href="https://selectgirls99.com/call-girls/Bhopal">Bhopal Escort Service</a>

Hi sweeties, my name is Kavya and I'm a young 21-year-old independent escort. I invite you to meet me in a hot encounter where you will know what the true pleasure of sex is.


Click here to read the complete article
Re: Freeing access-to-task objects

<th98ui$1atuq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: rosen@adalog.fr (J-P. Rosen)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sat, 1 Oct 2022 13:40:03 +0200
Organization: Adalog
Lines: 25
Message-ID: <th98ui$1atuq$1@dont-email.me>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 1 Oct 2022 11:40:03 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="f99a5a34ec8b6e3de08bff1d4a29b1fd";
logging-data="1406938"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wq5mOjrvcr+h4dWSuTvnP"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.1
Cancel-Lock: sha1:d7H9qX/pQn7SIPTbhNYmYgYgDwk=
Content-Language: fr
In-Reply-To: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
 by: J-P. Rosen - Sat, 1 Oct 2022 11:40 UTC

Le 30/09/2022 à 12:16, Emmanuel Briot a écrit :
> Please find a new blog post at:
>
> https://deepbluecap.com/freeing-task-access-objects/
>
> Abstract:
> Freeing Ada tasks could result in accessing freed memory. This post describes the proper way of freeing access-to-task objects.

I don't like an active loop to wait for task termination. There are
other ways:
1) declare the access type in a block, which is then the master of the
tasks. When you exit the block, the tasks are terminated.
2) declare in the tasks an entry which is never accepted, then call this
entry from the main. When the task terminates, it raises tasking_error
in the (unserved) callers - you can free the task from the exception
handler.

--
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: Freeing access-to-task objects

<th9a1c$8rn$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!UAyUbOgXzVgfYRW/bLvE8Q.user.46.165.242.91.POSTED!not-for-mail
From: mailbox@dmitry-kazakov.de (Dmitry A. Kazakov)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sat, 1 Oct 2022 13:58:37 +0200
Organization: Aioe.org NNTP Server
Message-ID: <th9a1c$8rn$1@gioia.aioe.org>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="9079"; posting-host="UAyUbOgXzVgfYRW/bLvE8Q.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.13.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Dmitry A. Kazakov - Sat, 1 Oct 2022 11:58 UTC

On 2022-10-01 13:40, J-P. Rosen wrote:
> Le 30/09/2022 à 12:16, Emmanuel Briot a écrit :
>> Please find a new blog post at:
>>
>> https://deepbluecap.com/freeing-task-access-objects/
>>
>> Abstract:
>> Freeing Ada tasks could result in accessing freed memory. This post
>> describes the proper way of freeing access-to-task objects.
>
> I don't like an active loop to wait for task termination.

IMO, it is the best method.

> There are
> other ways:
> 1) declare the access type in a block, which is then the master of the
> tasks. When you exit the block, the tasks are terminated.

That is usually not possible, or if possible, then the task object
itself can be in the block and no access type needed at all.

Almost all cases when access to task is used is due to language design
flaw not allowing either usable aggregation of task objects or
inheritance involving tasks.

> 2) declare in the tasks an entry which is never accepted, then call this
> entry from the main. When the task terminates, it raises tasking_error
> in the (unserved) callers - you can free the task from the exception
> handler.

This is uglier than a loop. However I must admit that it should have
advantage in terms of performance, both CPU load and latency. A
disadvantage is that you cannot wait for several tasks that way.

In a production code there is a timeout which limits the overall waiting
time and sometimes multiple tasks are awaited to terminate.

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

Re: Freeing access-to-task objects

<th9h7l$1bltq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sat, 1 Oct 2022 16:01:24 +0200
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <th9h7l$1bltq$1@dont-email.me>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 1 Oct 2022 14:01:25 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="6323368fc5684dbf250e5f4029baf67d";
logging-data="1431482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX184QH4hLSafzrFRQvlMY64LGB/bKBa3d0w="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:n13RuN2554qWQLAhLKtzFIuahO8=
Content-Language: en-US
In-Reply-To: <th98ui$1atuq$1@dont-email.me>
 by: Jeffrey R.Carter - Sat, 1 Oct 2022 14:01 UTC

On 2022-10-01 13:40, J-P. Rosen wrote:
>
> 1) declare the access type in a block, which is then the master of the tasks.
> When you exit the block, the tasks are terminated.

When you exit the block, the access type doesn't exist, so you can't free anything.

--
Jeff Carter
"Sir Lancelot saves Sir Gallahad from almost certain temptation."
Monty Python & the Holy Grail
69

Re: Freeing access-to-task objects

<b9f19317-5692-4f9c-8fb0-f9809b4b3575n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:1914:b0:6ce:5ac8:3b4f with SMTP id bj20-20020a05620a191400b006ce5ac83b4fmr9630136qkb.627.1664635545627;
Sat, 01 Oct 2022 07:45:45 -0700 (PDT)
X-Received: by 2002:a05:6214:4108:b0:4ac:b91b:5afd with SMTP id
kc8-20020a056214410800b004acb91b5afdmr10926136qvb.49.1664635545447; Sat, 01
Oct 2022 07:45:45 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Sat, 1 Oct 2022 07:45:45 -0700 (PDT)
In-Reply-To: <th9h7l$1bltq$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2a01:e0a:810:89e0:44d7:2f0e:881c:ef2f;
posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH
NNTP-Posting-Host: 2a01:e0a:810:89e0:44d7:2f0e:881c:ef2f
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b9f19317-5692-4f9c-8fb0-f9809b4b3575n@googlegroups.com>
Subject: Re: Freeing access-to-task objects
From: briot.emmanuel@gmail.com (Emmanuel Briot)
Injection-Date: Sat, 01 Oct 2022 14:45:45 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2055
 by: Emmanuel Briot - Sat, 1 Oct 2022 14:45 UTC

I did not mention it in the blog, but we also like running with the restriction No_Task_Hierarchy (which generates slightly more efficient code, at least in older versions of GNAT if I understand correctly the reasons we have it). So the declare block approach doesn't work, this is one of the big reasons for using access-to-task, too.

Waiting for exceptions is one possibility, though I dislike it because this is using exceptions for what is the normal flow of the program. They also make debugging more complicated.

The active loop is not the best solution, but it isn't very costly in practice. The task terminates fairly soon (depending on the load on the machine), and we could possibly use a delay like 1.0 if we basically want the active loop.

Re: Freeing access-to-task objects

<thaba8$1e0ba$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: bnl@nowhere.com (Björn Lundin)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sat, 1 Oct 2022 23:26:31 +0200
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <thaba8$1e0ba$1@dont-email.me>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9a1c$8rn$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 1 Oct 2022 21:26:32 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="83e97341c406278d0319cf1b63587d90";
logging-data="1507690"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18G6zGmW12raa6hcLHf7YU9"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha1:JW9MMMtBp8XIag8XN+j3vcpz4QA=
In-Reply-To: <th9a1c$8rn$1@gioia.aioe.org>
Content-Language: en-US
 by: Björn Lundin - Sat, 1 Oct 2022 21:26 UTC

On 2022-10-01 13:58, Dmitry A. Kazakov wrote:
> On 2022-10-01 13:40, J-P. Rosen wrote:
>> Le 30/09/2022 à 12:16, Emmanuel Briot a écrit :
>>> Please find a new blog post at:
>>>
>>> https://deepbluecap.com/freeing-task-access-objects/
>>>
>>> Abstract:
>>> Freeing Ada tasks could result in accessing freed memory. This post
>>> describes the proper way of freeing access-to-task objects.
>>
>> I don't like an active loop to wait for task termination.
>
> IMO, it is the best method.
>

I agree, in practice it works very well, at least for our system.
When ported to GNAT in 2003 I used this pattern.

We use it in IPC, where main makes a blocking call to a PO,
looking for incoming messages. The PO is protecting a list,
and main blocks on list_count = 0.

Another task (receive task) in the IPC body blocks on a read call from a
named pipe.
When a message arrives in the pipe, this task is putting it into the
PO's list.

Main then unblocks, since list_count >0, gets the message and treats it,

But since the receiver task is blocking as well, it is difficult to make
that call timeout. Sometimes we want main to actually block until a
message arrives, but sometimes we'd like to timeout after a minute or so.

Main can call the receive procedure with or without a timeout.

If time is used in the call, a third task is started - with new - with a
timeout time, and a 'stop' entry. This timer task just delays timeout
time, and writes a timeout message to the pipe when expired - thus
releasing the blocking task, and also releasing main since a timeout
message was put in PO's list and list_count becomes > 0.

If a message is put by another process in the pipe, the receiving task
calls stop on the timer task, removes any timeout messages in the list
if we had a race, and puts the message in the list.

Here we also loop over the timer task until terminated.

Worked very well for many years in many installations

We do send messages frequently. in bursts up to 100 msgs/s
but average is less likely than 10 msgs/s

1_000_000 msgs/day is not unusual, so memleaks here is a problem

--
/Björn

Re: Freeing access-to-task objects

<86a665htb0.fsf@stephe-leake.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!gy7opw3oYmwPg+L8gXeD2w.user.46.165.242.75.POSTED!not-for-mail
From: stephen_leake@stephe-leake.org (Stephen Leake)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sun, 09 Oct 2022 09:10:11 -0700
Organization: Aioe.org NNTP Server
Message-ID: <86a665htb0.fsf@stephe-leake.org>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="49643"; posting-host="gy7opw3oYmwPg+L8gXeD2w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:z52eE8wOBow0oky+stBBv/3gGJM=
 by: Stephen Leake - Sun, 9 Oct 2022 16:10 UTC

"Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes:

> On 2022-10-01 13:40, J-P. Rosen wrote:
>> 1) declare the access type in a block, which is then the master of
>> the tasks. When you exit the block, the tasks are terminated.
>
> When you exit the block, the access type doesn't exist, so you can't
> free anything.

But Ada frees all objects allocated using the locally declared access
type when the block is exited.

--
-- Stephe

Re: Freeing access-to-task objects

<thv87e$f6s8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Sun, 9 Oct 2022 21:42:38 +0200
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <thv87e$f6s8$1@dont-email.me>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me>
<86a665htb0.fsf@stephe-leake.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 9 Oct 2022 19:42:38 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="902b48236e336f1880727d3b153a34f2";
logging-data="498568"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198uNtsIBQaalbnBQEWCpeJG7rvboNn1ys="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:U6F5Bo40SFRq2axC+BokHorrHl8=
In-Reply-To: <86a665htb0.fsf@stephe-leake.org>
Content-Language: en-US
 by: Jeffrey R.Carter - Sun, 9 Oct 2022 19:42 UTC

On 2022-10-09 18:10, Stephen Leake wrote:
> "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes:
>
>> On 2022-10-01 13:40, J-P. Rosen wrote:
>>> 1) declare the access type in a block, which is then the master of
>>> the tasks. When you exit the block, the tasks are terminated.
>>
>> When you exit the block, the access type doesn't exist, so you can't
>> free anything.
>
> But Ada frees all objects allocated using the locally declared access
> type when the block is exited.

This is only required if the access type has Storage_Size specified (ARM
13.11/18.4 http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-11.html#I5208).

--
Jeff Carter
"I was hobbling along, minding my own business, all of a
sudden, up he comes, cures me! One minute I'm a leper with
a trade, next minute my livelihood's gone! Not so much as a
'by your leave!' You're cured, mate. Bloody do-gooder!"
Monty Python's Life of Brian
76

Re: Freeing access-to-task objects

<lyh70cm6zz.fsf@pushface.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!aioe.org!Yr2L9qaRshuL+yFKTxsDBA.user.46.165.242.75.POSTED!not-for-mail
From: simon@pushface.org (Simon Wright)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Mon, 10 Oct 2022 09:13:04 +0100
Organization: Aioe.org NNTP Server
Message-ID: <lyh70cm6zz.fsf@pushface.org>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me>
<86a665htb0.fsf@stephe-leake.org> <thv87e$f6s8$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="15962"; posting-host="Yr2L9qaRshuL+yFKTxsDBA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:nBMcfhQ738y4LAYLpb90OmWmmow=
 by: Simon Wright - Mon, 10 Oct 2022 08:13 UTC

"Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes:

> This is only required if the access type has Storage_Size specified
> (ARM 13.11/18.4
> http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-11.html#I5208).

I think you meant ARM 13.11(18/4),
http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-11.html#p18
(note simpler way of referencing a para in a link, works for rm12 or
later).

Given this,

declare
type T_P is access T with Storage_Size => 1024;
P : T_P;
begin
P := new T;
end;

would you expect P to be deallocated as the block is left? because it
isn't with GCC 12.1.0, x86_64-apple-darwin.

Re: Freeing access-to-task objects

<ti1hki$rii9$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: spam.jrcarter.not@spam.acm.org.not (Jeffrey R.Carter)
Newsgroups: comp.lang.ada
Subject: Re: Freeing access-to-task objects
Date: Mon, 10 Oct 2022 18:35:30 +0200
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <ti1hki$rii9$1@dont-email.me>
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me>
<86a665htb0.fsf@stephe-leake.org> <thv87e$f6s8$1@dont-email.me>
<lyh70cm6zz.fsf@pushface.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 10 Oct 2022 16:35:30 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="aa7118bfbbbecd68cb1b6f4611157287";
logging-data="903753"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186HuEixxP4n1g+rsMktFjjj0uF2ZNQEiQ="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.2.2
Cancel-Lock: sha1:TXAqSQbuVfMKFTmLiCohtGI+AAM=
Content-Language: en-US
In-Reply-To: <lyh70cm6zz.fsf@pushface.org>
 by: Jeffrey R.Carter - Mon, 10 Oct 2022 16:35 UTC

On 2022-10-10 10:13, Simon Wright wrote:
> "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not> writes:
>
>> http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-11.html#I5208).
>
> I think you meant ARM 13.11(18/4),
> http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-11.html#p18
> (note simpler way of referencing a para in a link, works for rm12 or
> later).

I used the link from the index.

> declare
> type T_P is access T with Storage_Size => 1024;
> P : T_P;
> begin
> P := new T;
> end;
>
> would you expect P to be deallocated as the block is left? because it
> isn't with GCC 12.1.0, x86_64-apple-darwin.

Technically, it says the storage for the implementation-defined storage pool
associated with T_P is reclaimed, not that anything is deallocated. Still,
sounds like a compiler error.

--
Jeff Carter
"Help! Help! I'm being repressed!"
Monty Python & the Holy Grail
67

Re: Freeing access-to-task objects

<36d635a5-7280-4ca8-8564-3cccde40bb9fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.ada
X-Received: by 2002:a05:620a:b51:b0:6cf:68b2:d86e with SMTP id x17-20020a05620a0b5100b006cf68b2d86emr14305082qkg.176.1665433384606;
Mon, 10 Oct 2022 13:23:04 -0700 (PDT)
X-Received: by 2002:a37:a996:0:b0:6ec:59da:a72 with SMTP id
s144-20020a37a996000000b006ec59da0a72mr5731620qke.676.1665433384464; Mon, 10
Oct 2022 13:23:04 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.ada
Date: Mon, 10 Oct 2022 13:23:04 -0700 (PDT)
In-Reply-To: <86a665htb0.fsf@stephe-leake.org>
Injection-Info: google-groups.googlegroups.com; posting-host=94.31.101.23; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf
NNTP-Posting-Host: 94.31.101.23
References: <b752f3d4-ecff-4ec6-b39d-439571ceaec8n@googlegroups.com>
<th98ui$1atuq$1@dont-email.me> <th9h7l$1bltq$1@dont-email.me> <86a665htb0.fsf@stephe-leake.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <36d635a5-7280-4ca8-8564-3cccde40bb9fn@googlegroups.com>
Subject: Re: Freeing access-to-task objects
From: christ-usch.grein@t-online.de (AdaMagica)
Injection-Date: Mon, 10 Oct 2022 20:23:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1683
 by: AdaMagica - Mon, 10 Oct 2022 20:23 UTC

Stephen Leake schrieb am Sonntag, 9. Oktober 2022 um 18:10:15 UTC+2:
> But Ada frees all objects allocated using the locally declared access
> type when the block is exited.

Finalizing and Deallocation are often confused. If the scope of the access is left, all still existing objects allocated are finalized in some order. As others have said, storage is reclaimed only if Storage_Size is given.

Finalization does not deallocate; but Deallocation does finalization.


devel / comp.lang.ada / Freeing access-to-task objects

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor