comp.lang.ada
 help / color / mirror / Atom feed
From: "ldb" <ldb_nospam@hotmail.com>
Subject: Tasking, protected objects, Ada 95 RM
Date: 18 Jul 2006 08:09:57 -0700
Date: 2006-07-18T08:09:57-07:00	[thread overview]
Message-ID: <1153235397.700369.134780@35g2000cwc.googlegroups.com> (raw)

I have a bit of tasking code that works pretty good. I'm still
stress-testing it to put the stamp of approval on it, and have come
across somethign that's a bit alarming.

My code is meant to do a big parallel computation in a multithreaded
fashion. I have a big buffer of data chunks to be processed, and a
bunch of tasks feeding off that buffer processing data. Simple enough.

During the buffers initialization, it has an entry call for "connect"
where tasks can connect and it can keep track of how many tasks are
currently "reading" from it. These tasks can then do "get_chunk".
Pretty simple, so far so good.

During the Task initilization, they have an "accept" statement from the
main program that will point them to a buffer from which to read data.
Inside this "accept" statement, they make a call to the buffer.connect
function.

This, in essence, is an atmoic "accept" statement making a calling to a
protected types "entry" statement. This leads to the following alarming
statement in the ada 95 RM:

From: http://www.grammatech.com/rm95html-1.0/rm9x-09-05-01.html
> During a protected action, it is a bounded error to invoke an operation that is potentially blocking.

It goes on to define potentially blocking actions as, of course, an
entry_call. Now, I've never had my code raise a bounded error or a
program error. Here is a quick synopsis of my questions:

1) Am I misunderstanding this particular part of the manual, and it, in
fact, doesn't apply to my code?
2) Should I be worried?
3) Will -gnatp prevent this exception from being raised?




             reply	other threads:[~2006-07-18 15:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-18 15:09 ldb [this message]
2006-07-18 15:22 ` Tasking, protected objects, Ada 95 RM Ed Falis
2006-07-18 15:30   ` Ed Falis
2006-07-18 19:15 ` Georg Bauhaus
2006-07-18 21:12 ` Randy Brukardt
2006-07-19 14:00   ` ldb
  -- strict thread matches above, loose matches on Subject: below --
2006-07-18 16:38 Anh Vo
replies disabled

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