Re: Multitasking and containers
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Nov 2006 11:19:23 +0100
On Fri, 24 Nov 2006 09:51:24 +0100, Maciej Sobczak wrote:
Paragraph 3 in Annex A says that it's OK to call any standard subprogram
from concurrent tasks as long as the parameters do not overlap. John
Barnes ("Progamming in Ada 2005") suggests that in order to (for
example) read from the same container, the operations need to be
protected "by using the normal techniques such as protected objects".
But reading from the protected object is not mutually exclusive (many
readers are allowed) - so where's the gain? What's the difference
between concurrent reads of, say, a Vector via protected object vs.
direct access?
I think he didn't mean container being a protected object. It would be
difficult to do, because protected types alas aren't tagged. So I read it
as "by using a locking/serialization technique, such as mutex, which can be
implemented as a protected object."
[ I don't know if ARM 2005 permits mutable implementations of read
operations on the containers. I suppose it does, so the need to lock upon
read. ]
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- Follow-Ups:
- Re: Multitasking and containers
- From: Matthew Heaney
- Re: Multitasking and containers
- From: Maciej Sobczak
- Re: Multitasking and containers
- References:
- Multitasking and containers
- From: Maciej Sobczak
- Multitasking and containers
- Prev by Date: Re: Multitasking and containers
- Next by Date: Re: Multitasking and containers
- Previous by thread: Re: Multitasking and containers
- Next by thread: Re: Multitasking and containers
- Index(es):
Relevant Pages
|