Thibault Germentier wrote:
> Hello,
>
> Procedures are stateless entities that are copied without distributed
> computation because they are constants. So the procedure is executed on
> the client process and success is displayed at standard output. But
> messagePort is unreachable because network transparency is not applied to
> it.
>
>
that's *not* true. for the first, you'll find code quite like this in
ctmcp, with an explanation on how it *works*. and it does work, the
problem is not that the message port is inaccessible (yes it is
accessible), but rather that the server stops responding and takes up
all of the cpu time.
> As the procedure is executed on client process, messagePort should be
> accessed by a pickle in it.
>
to my understanding, the procedure (actually, a stub, a marshalled copy
of it) is executed on the client side, and is transported from the
server to the client in a pickled form; but does that change anything?
the whole purpose of rmi -- which the below is a form of, i'd like to
think -- is to make the remoteness of remote objects invisible to the
user. that means, it plays no role if the object is a procedure, a
port, or whatever.
here's a modified example:
%server
functor ...
define
Requests RequestPort = {NewPort Requests}
{Pickle.save {Connection.offer RequestPort} ...}
{ForAll Requests proc {$ Request} {Send Request response} end}
end
%client
functor ...
define
Responses ResponsePort = {NewPort Responses}
RequestPort = {Connection.take {Pickle,load ...}}
{Send RequestPort ResponsePort}
{System.show Response.1}
{Application.exit 0}
end
here, the client gets a remote object which is a port, it sends to the
port its own port, to which the server sends an atom. the client then
displays the atom, and terminates. all works fine, but as soon as the
client terminates, the server starts spinning.
> All of this should be validated by a mozart's guru because I'm not sure of
> it ...
>
this would be great. i get a feeling that there's something about the
system that i don't quite understand, but i can't get it from the docs.
both examples from ctmcp and code from online tutorials (taken as it is)
cause the same problem.
vQ
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users