From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b8d84902e214ddae X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Help on Protected Objects.. Date: 1996/06/23 Message-ID: #1/1 X-Deja-AN: 162331903 distribution: World references: <31ca8b58.6226611@news.ntua.gr> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-06-23T00:00:00+00:00 List-Id: 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.