User talk:Dmitry-kazakov: Difference between revisions

From Rosetta Code
Content added Content deleted
(Some explanations)
Line 26: Line 26:
end;
end;
They look like they are masking/ignoring the ''Out_Of_Ink'' exception.
They look like they are masking/ignoring the ''Out_Of_Ink'' exception.

:Yes, this is on the server side. When an exception is propagated out of an entry point, that happens both on the server and the client sides. In our case the server just ignores it. The client ends. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:32, 19 February 2009 (UTC)


Whereas program appears to propagate ''Out_Of_Ink'' back to ''Mother_Goose''. e.g.
Whereas program appears to propagate ''Out_Of_Ink'' back to ''Mother_Goose''. e.g.
requeue Backup.Print with abort;
requeue Backup.Print with abort;
Is that because of the ''with abort''?
Is that because of the ''with abort''?

:''with abort'' means that it is allowed for the client to cancel the rendezvous request while it waits in the queue of ''Backup''. If ''Mother_Goose'' have used a timed entry call:
<blockquote>
<lang ada>
select
Main.Print (...);
or delay 5.0;
Put_Line ("No response from the printer");
end select;
</lang>
</blockquote>
:then if the rendezvous to ''Backup'' would not engaged in 5 seconds (including the waiting time for ''Main'') then it would output "No response from the printer". --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:32, 19 February 2009 (UTC)


Also: when the task is requeued, does the ''Main'' printer suspend
Also: when the task is requeued, does the ''Main'' printer suspend
waiting for ''Backup'' to finish? (Or is the exception propagated directly
waiting for ''Backup'' to finish? (Or is the exception propagated directly
back from ''Backup'' to ''Mother_Goose'' without passing through ''Main'')
back from ''Backup'' to ''Mother_Goose'' without passing through ''Main'')

:No, the server ''Main'' continues when the entry point body is left, the client (say ''Mother_Goose'') stay blocked and waits now for the new server ''Backup'' to service the rendezvous. --[[User:Dmitry-kazakov|Dmitry-kazakov]] 08:32, 19 February 2009 (UTC)


ThanX
ThanX

Revision as of 08:32, 19 February 2009

Language Table

I was thinking about adding a "parameter passing methods available" column to the big language table. If I do, it should probably have an informational article to go with it. Do you think you're up for it? --Mwn3d 03:30, 23 July 2008 (UTC)

I'll try. --Dmitry-kazakov 07:18, 23 July 2008 (UTC)


binary mode

About the problem you talk about on the ppm output article, I am used to see that it is possible to open a file in binary mode on your OS.
Isn't it possible with this programming language ? Blue Prawn 11:28, 7 December 2008 (UTC)

It is OS-specific too. In earlier times, when OS was an OS (:-)), there was RSX-11, for example. It didn't have text files in MS-DOS or UNIX sense. There were record files instead. Each line was stored into a record. The advantage was that a line could contain any characters and LF, CR or NUL had no special meaning.
I will rewrite Ada solution in order to make it more portable, but I am afraid the problem with it and other solutions as well will persist. Because if we used binary in the sense stream of characters, then we would have to specify a few more things to make it portable:
  • character is? (octet of bits)
  • line terminator in the file header is? (ASCII LF for example)
  • EOF is? (ASCII LF, NUL, nothing)
And well, PPM isn't our fault... (:-)) --Dmitry-kazakov 12:17, 7 December 2008 (UTC)

exception propagation in Ada.

In Ada's Rendezvous what do these lines do:

        exception
           when Out_Of_Ink =>
              null;
        end;

They look like they are masking/ignoring the Out_Of_Ink exception.

Yes, this is on the server side. When an exception is propagated out of an entry point, that happens both on the server and the client sides. In our case the server just ignores it. The client ends. --Dmitry-kazakov 08:32, 19 February 2009 (UTC)

Whereas program appears to propagate Out_Of_Ink back to Mother_Goose. e.g.

                       requeue Backup.Print with abort;

Is that because of the with abort?

with abort means that it is allowed for the client to cancel the rendezvous request while it waits in the queue of Backup. If Mother_Goose have used a timed entry call:

<lang ada> select Main.Print (...); or delay 5.0; Put_Line ("No response from the printer"); end select; </lang>

then if the rendezvous to Backup would not engaged in 5 seconds (including the waiting time for Main) then it would output "No response from the printer". --Dmitry-kazakov 08:32, 19 February 2009 (UTC)

Also: when the task is requeued, does the Main printer suspend waiting for Backup to finish? (Or is the exception propagated directly back from Backup to Mother_Goose without passing through Main)

No, the server Main continues when the entry point body is left, the client (say Mother_Goose) stay blocked and waits now for the new server Backup to service the rendezvous. --Dmitry-kazakov 08:32, 19 February 2009 (UTC)

ThanX

NevilleDNZ 06:33, 19 February 2009 (UTC)