comp.lang.ada
 help / color / mirror / Atom feed
* protected objects and data structures
@ 2001-09-06 15:09 Tony Gair
  2001-09-06 15:45 ` James Rogers
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Gair @ 2001-09-06 15:09 UTC (permalink / raw)




Has anyone here used a predefined ada data structure inside a protected object.

My problem is that I need to store a undefined amount of variant records inside a
protected variable / object.

Any ideas

Regards
Tony Gair



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: protected objects and data structures
  2001-09-06 15:09 protected objects and data structures Tony Gair
@ 2001-09-06 15:45 ` James Rogers
  2001-09-07 17:51   ` Tucker Taft
  0 siblings, 1 reply; 3+ messages in thread
From: James Rogers @ 2001-09-06 15:45 UTC (permalink / raw)


Sure.

With variant records you will need to create the linked list such that
each element is dynamically allocated and the node is initialized with
the variant being stored. This will work unless the variant record you
are allocating contains a task object. In that case the allocation is
potentially blocking. Potentially blocking operations are forbidden in
a protected operation.

Jim Rogers
Colorado Springs, Colorado USA

Tony Gair wrote:
> 
> Has anyone here used a predefined ada data structure inside a protected object.
> 
> My problem is that I need to store a undefined amount of variant records inside a
> protected variable / object.
> 
> Any ideas



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: protected objects and data structures
  2001-09-06 15:45 ` James Rogers
@ 2001-09-07 17:51   ` Tucker Taft
  0 siblings, 0 replies; 3+ messages in thread
From: Tucker Taft @ 2001-09-07 17:51 UTC (permalink / raw)


James Rogers wrote:
> 
> Sure.
> 
> With variant records you will need to create the linked list such that
> each element is dynamically allocated and the node is initialized with
> the variant being stored. This will work unless the variant record you
> are allocating contains a task object. In that case the allocation is
> potentially blocking. Potentially blocking operations are forbidden in
> a protected operation.

Just to be clear, allocation is never potentially blocking.
It is the initialization of the object that might
be potentially blocking.  In the very rare
case of putting a task inside a variant record, you
could get into trouble.  In general, however, it is
perfectly fine to use linked lists of variant or tagged
records inside protected objects.

> 
> Jim Rogers
> Colorado Springs, Colorado USA

-Tucker Taft  stt@avercom.net
> 
> Tony Gair wrote:
> >
> > Has anyone here used a predefined ada data structure inside a protected object.
> >
> > My problem is that I need to store a undefined amount of variant records inside a
> > protected variable / object.
> >
> > Any ideas

-- 
-Tucker Taft   stt@avercom.net   http://www.avercom.net
Chief Technology Officer, AverCom Corporation (A Titan Company) 
Bedford, MA  USA (AverCom was formerly the Commercial Division of AverStar:
http://www.averstar.com/~stt)



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-09-07 17:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-06 15:09 protected objects and data structures Tony Gair
2001-09-06 15:45 ` James Rogers
2001-09-07 17:51   ` Tucker Taft

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