comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <bnl@spray.se>
To: Jacob Sparre Andersen <sparre@nbi.dk>
Cc: comp.lang.ada@ada-france.org
Subject: Re: Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types)
Date: Fri, 29 Apr 2005 17:23:11 +0200
Date: 2005-04-29T17:23:11+02:00	[thread overview]
Message-ID: <mailman.101.1114788216.24457.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <m2acnhn43i.fsf_-_@hugin.crs4.it>

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]


2005-04-29 kl. 14.45 skrev Jacob Sparre Andersen:

> Adrien Plisson wrote:
>> Jacob Sparre Andersen wrote:
>
>>> If calls to Ada.Text_IO _are_ potentially blocking operations,
>>> that means that one has to move the calls to a task.
>>
>> and what about putting them into an entry of a protected object?
>


> I think I need an explanation of the difference between entries and
> procedures of protected objects.  Any suggestion of some reading
> materials?
>
  Ada As A Second Language by Norman Cohen

<http://www.amazon.com/exec/obidos/tg/detail/-/0070116075/103-0300811 
-4955053?v=glance>
Has a nice and long chapter about protected objects and tasking

As a remark to the issue of text_io being potentially blocking, I've  
developed code
that works as it should with Windows and gnat, but came to a total  
freeze of the process
when compiled with Object Ada. The freeze occured when calling text_io  
inside a protected procedure.
Replacing the protected object with another task solved it.

In the book above, the author mentions that io inside protected objects  
will either freeze the process,
or work, but with the protection disabled, or work very well? Anyway, I  
will always be carefull with
protected objects in the future.

/Björn
Björn Lundin
bnl at spray dot se

[-- Attachment #2: Type: text/enriched, Size: 1727 bytes --]



2005-04-29 kl. 14.45 skrev Jacob Sparre Andersen:


<excerpt>Adrien Plisson wrote:

<excerpt>Jacob Sparre Andersen wrote:

</excerpt>

<excerpt><excerpt>If calls to Ada.Text_IO _are_ potentially blocking
operations,

that means that one has to move the calls to a task.

</excerpt>

and what about putting them into an entry of a protected object?

</excerpt>

</excerpt>


<excerpt>I think I need an explanation of the difference between
entries and

procedures of protected objects.  Any suggestion of some reading

materials?


</excerpt><fontfamily><param>Arial</param><x-tad-bigger>
</x-tad-bigger><bold><x-tad-bigger>Ada</x-tad-bigger></bold><x-tad-bigger>
As A
</x-tad-bigger><bold><x-tad-bigger>Second</x-tad-bigger></bold><x-tad-bigger> </x-tad-bigger><bold><x-tad-bigger>Language</x-tad-bigger></bold><x-tad-bigger>
by Norman Cohen


<<http://www.amazon.com/exec/obidos/tg/detail/-/0070116075/103-0300811-4955053?v=glance>

Has a nice and long chapter about protected objects and tasking


</x-tad-bigger></fontfamily>As a remark to the issue of text_io being
potentially blocking, I've developed code

that works as it should with Windows and gnat, but came to a total
freeze of the process

when compiled with Object Ada. The freeze occured when calling text_io
inside a protected procedure.

Replacing the protected object with another task solved it.


In the book above, the author mentions that io inside protected
objects will either freeze the process, 

or work, but with the protection disabled, or work very well? Anyway,
I will always be carefull with

protected objects in the future.


/Björn

Björn Lundin

bnl at spray dot se


  parent reply	other threads:[~2005-04-29 15:23 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-29  4:04 [newbie question] tasks and protected types fabio de francesco
2005-04-29  7:25 ` tmoran
2005-04-29  9:43 ` Jacob Sparre Andersen
2005-04-29 10:34   ` Alex R. Mosteo
2005-04-29 11:23     ` Jacob Sparre Andersen
2005-04-29 12:18       ` Adrien Plisson
2005-04-29 12:45         ` Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types) Jacob Sparre Andersen
2005-04-29 13:22           ` Poul-Erik Andreasen
2005-04-29 14:26           ` Egil H. H�vik
2005-04-29 20:28             ` Jacob Sparre Andersen
2005-04-29 20:39             ` Randy Brukardt
2005-04-29 21:23               ` Lionel Draghi
2005-04-29 22:11                 ` fabio de francesco
2005-04-30  3:45                   ` Jeffrey Carter
2005-04-30  7:21                   ` Lionel Draghi
2005-05-02  8:11                 ` Jean-Pierre Rosen
2005-04-30 12:47               ` Ada.Text_IO and protected objects Stephen Leake
2005-04-29 21:57             ` Ada.Text_IO and protected objects (Was: [newbie question] tasks and protected types) fabio de francesco
2005-04-30  9:07               ` Ada.Text_IO and protected objects Jacob Sparre Andersen
2005-04-30 10:21                 ` Dmitry A. Kazakov
2005-05-02 10:41                   ` fabio de francesco
2005-05-02 14:10                     ` Jacob Sparre Andersen
2005-05-02 16:29                       ` fabio de francesco
2005-04-29 15:23           ` Björn Lundin [this message]
2005-04-29 12:54       ` [newbie question] tasks and protected types Alex R. Mosteo
2005-04-29 10:47   ` fabio de francesco
2005-04-29 11:33     ` Jacob Sparre Andersen
2005-04-29 12:55       ` Alex R. Mosteo
2005-04-29 14:06         ` Egil H. H�vik
2005-04-29 14:12           ` Egil H. H�vik
2005-04-29 16:23             ` Robert A Duff
2005-04-29 20:19           ` Jacob Sparre Andersen
2005-04-30 11:58           ` Simon Wright
replies disabled

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