comp.lang.ada
 help / color / mirror / Atom feed
* Tasking, protected objects, Ada 95 RM
@ 2006-07-18 15:09 ldb
  2006-07-18 15:22 ` Ed Falis
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: ldb @ 2006-07-18 15:09 UTC (permalink / 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?




^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Tasking, protected objects, Ada 95 RM
@ 2006-07-18 16:38 Anh Vo
  0 siblings, 0 replies; 7+ messages in thread
From: Anh Vo @ 2006-07-18 16:38 UTC (permalink / raw)
  To: comp.lang.ada

> >>> Ed Falis <falis@verizon.net> 7/18/2006 8:30:18 AM >>>
> Ed Falis wrote:

> > An accept statement is not a protected action in the technical
jargon
> > of
> > the RM.  So calling connect from there is not potentially
blocking.

> Sorry, it is "potentially blocking" but not in a manner that is
> meaningful in the context of the quote you gave from the RM - it is
not
> a bounded error in this case.

Tasking is always my favorite interest. In fact, this is a cool,
advanced and complex stuff. Beside Ed's answer, I would suggest that
your codes be posted, if it is not proprietary. This makes the
discussion more precise and no misunderstanding :-)

AV



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

end of thread, other threads:[~2006-07-19 14:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-18 15:09 Tasking, protected objects, Ada 95 RM ldb
2006-07-18 15:22 ` 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

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