Closed vicuna closed 23 years ago
Comment author: administrator
At some time, I try to send a 'behavior', that's to say a special function. Therefore, I first marshal it, then I send it. But it fails and an exception Invalid_argument is raised. I know the functions of module Marshal don't work with bytecode-threads, so I use a trick given by X. Leroy.
Right. The Marshall module will be thread-safe in future releases.
Here is what happens: Fatal error: uncaught exception Invalid_argument("output_value: object value") I tried to look at the C code in byterun/extern.c in the OCaml 3.00 distribution, but I didn't understand very much. I saw that the system finds an Object_tag which I wonder where the system finds it :-)
Well, it means that the data structure you gave to the marshaller contains an object somewhere (including in the closures of the functions that you're marshalling). Maybe in the Mutable_queue.t type? Also, it seems that your data may contain mutexes and conditions, which you cannot marshal reliably.
Generally speaking, the OCaml marshaller works only for pure, passive data structures: no functions, no objects, no stateful things like file descriptors and mutexes. The Marshal.Closures flag allows functions to be marshaled under some circumstances, but it's really a hack that works only for very simple SPMD programming.
I agree this makes the marshaller insufficient for advanced distributed programming -- the Join Calculus / JoeCaml people also have problems with this. But there is no ideal solution known currently.
Comment author: administrator
Inherent limitations of the marshaler.
Original bug ID: 168 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Hi,
Thank you for your message to the Caml mailing list.
However your message seems to be a bug report; hence I send it to the relevant mailing list
caml-bugs@inria.fr
Thank again for your interest in Caml.
Pierre Weis
INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://cristal.inria.fr/~weis/