comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Help on Protected Objects..
Date: 1996/06/23
Date: 1996-06-23T00:00:00+00:00	[thread overview]
Message-ID: <dewar.835537104@schonberg> (raw)
In-Reply-To: 31ca8b58.6226611@news.ntua.gr

E Karakoulakis asks:

   Hello, I'm having a problem on protected objects and tasks.
   I've built a client/server program that simulates a Bank (deposits,
   withdrawals etc.) for a Course Exercise. I use a Protected Type to
   handle critical actions (i.e. reading and writing to accounts), and
   I've found out that calls to protected procedure WriteAccount, are
   sometimes silently ignored, (I suspect when the object they try to
   alter is in use.).

Either there is a bug in the compiler you are using, or your analysis
is quite wrong. Calls to protected procedures are never "silently
ignored", and you get automatic locking, that is the whole point of
protected objects. So I am afraid you will have to look elsewhere to
see why your assignment is not working. Did you put print statements
before the calls, and in the body of the protected procedure? You
probably can't do Text_IO calls in such a context (since it is likely
that Text_IO may do some potentially blocking operations), but you
can certainly call a C routine to output some debugging information,
or if you are using GNAT, use GNAT.IO for such output (GNAT.IO is
quite useful for debugging, because it does not do any potentially
blocking operations, and also it is preelaborated, so it can be
called to debug stuff in preelaborated packages.





      reply	other threads:[~1996-06-23  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-21  0:00 Help on Protected Objects Elias Karakoulakis
1996-06-23  0:00 ` Robert Dewar [this message]
replies disabled

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