comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Attempting to create file i task
Date: Wed, 17 Mar 2021 16:01:11 +0100	[thread overview]
Message-ID: <s2t5jk$ajn$1@gioia.aioe.org> (raw)
In-Reply-To: 08e35535-f3b8-4c6f-accb-4be015111fb7n@googlegroups.com

On 2021-03-17 15:17, reinert wrote:
> onsdag 17. mars 2021 kl. 13:49:23 UTC+1 skrev J-P. Rosen:
>> Le 17/03/2021 à 13:39, reinert a écrit :
> .......
>>>
>> Create always "creates" the file, i.e. if it exists, it is overwritten.
>> What would you expect?
> 
> Sorry to be imprecise. The files for two instances of the task have different names.
> For example "name_1" and "name_2" respectively. My problem is that the (external) file "name_1" is overwritten.
> When I run the two task separately (with various tasks between) then "name_1" is not overwritten.

Look how you pass the file name to the tasks. Normally there must be an 
entry point that *copies* the parameter during rendezvous to a 
task-local string and opens the file with the copy after leaving the 
rendezvous.

But if you come to an idea of using a global variable, an unbounded 
string or anything alike with *referential* semantics, you will get 
bitten, if that is updated concurrently.

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

  parent reply	other threads:[~2021-03-17 15:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 12:39 Attempting to create file i task reinert
2021-03-17 12:49 ` J-P. Rosen
2021-03-17 14:17   ` reinert
2021-03-17 14:21     ` reinert
2021-03-17 14:34     ` Jeffrey R. Carter
2021-03-17 15:01     ` Dmitry A. Kazakov [this message]
2021-03-17 16:19     ` J-P. Rosen
2021-03-17 16:56       ` reinert
2021-03-17 20:13         ` Simon Wright
2021-03-17 14:18   ` AdaMagica
2021-03-17 14:33     ` Jeffrey R. Carter
2021-03-17 14:34     ` reinert
2021-03-17 14:47       ` AdaMagica
2021-03-17 15:37         ` Jeffrey R. Carter
2021-03-17 16:56           ` AdaMagica
2021-03-17 15:20 ` Shark8
replies disabled

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