Hello,
making the change you suggested made the application block completely
sending a bug report so I kept the old version.
The weird thing is that this warning sometimes appears and sometimes it
doesn't (even though I don't recall changing anything) and in both cases I
get the famous error:

%********************** error in application *************
%**
%** Application of non-procedure and non-object
%**
%** In statement: {<Resource> getX(_<optimized>)})

(I'm thinking of switching to Mozart 1.4 and see if the error becomes
clearer.)

I've noticed something, this warning appears if I click on the main.exe
generated after ozc -x main.oz but if ran ./main using Cygwin the warning
doesn't appear. Any explanation?

*> I don't think this is related to threads. While threads themselves
> cannot be distributed, objects that merely use threads should not
> cause problems when distributed.*
Are you sure about this? because I don't want to change the class that uses
threads at all.

I wanted to ask something about the class using threads. Since this class is
going to be used by different instances created from some other class (which
also use threads and which are stationary on the sites where they are
created) distributed among many sites. Is this instace going to travel among
the sites so that it can be used by all the instances that need it? If so,
is the application going to work the same way as if it weren't distributed
(because this is exactly what I want)?

Thanks again and I really appreciate your help.

2010/9/9 Wolfgang Meyer <[email protected]>

> Hello,
>
> I don't think this is related to threads. While threads themselves
> cannot be distributed, objects that merely use threads should not
> cause problems when distributed.
> I wonder whether the warning might be related to the
> CreateRemoteStationaryObject procedure that I proposed earlier. In
> this procedure, a "failed value" is created when a problem occurs.
> Maybe distribution of failed values can cause problems in Mozart 1.3.2
> You could try to replace this line:
>
> {Value.failed E}
>
> with
>
> error(E)
>
> and see whether the warning goes away.
> This is just a wild guess, though. Not sure whether there is any relation.
>
> Cheers,
>   Wolfgang
>
> On Thu, Sep 9, 2010 at 4:01 PM, Khadija EL MAHRSI
> <[email protected]> wrote:
> > Hello,
> > could this warning be caused by the use of threads? I read in the
> > documentation that due to limitations of the current release threads are
> > sited even though they are in base modules and I was wondering how can I
> get
> > around this limitation (Correct me if I'm wrong but I did some research
> and
> > it doesn't seem that this has changed with Mozart 1.4).
> >
> > This is the main idea, in my application I have 2 classes (class1 and
> > class2) and one of them (class1) uses a thread in its init method. In my
> > main.oz I create an instance of both classes. Class2's instance is
> > stationary and runs on a remote site and I want to pass the class1's
> > instance to class2's init method as parameter so that it can be affected
> as
> > one of class2's attributes or features. Maybe this is where it goes
> wrong?
> > Sigh, everything sure is different and more difficult when trying to do
> > distributed applications (centralized applications are rather easier to
> > achieve) especially for someone who isn't an expert such as myself :-(
> >
> > Forgive my constant questions but I'm still trying to get the hang of
> this
> > language (which is still very new to me) and there is no one else to ask
> > since unlike other programming languages I had used, this mailing list is
> > the only solution when facing a problem whose solution is not easy to
> find
> > on one's own so I humbly ask for your help.
> >
> > Thanks.
> >
> > 2010/9/5 Boriss Mejias <[email protected]>
> >>
> >> Hi Khadija,
> >>
> >> The warning "marshaling a variable as a resource" is related to your
> >> previous question about sending {OS.rand} to a remote site, and execute
> it
> >> over there. OS, as well as System and other modules, cannot be exported
> to a
> >> remote site because they are considered resources of the machine. So,
> when
> >> you try to distribute a piece of code such as {OS.rand}, it just
> marshals it
> >> as a resource, and cannot be used remotely.
> >>
> >> I hope it helps
> >> cheers
> >> Boriss
> >>
> >>
> >>
> >> On 04/09/10 18:59, Khadija EL MAHRSI wrote:
> >>>
> >>> Hello,
> >>> I was wondering if anyone had any idea about the following execution
> >>> warning and can explain it to me:
> >>> Warning: marshaling a variable as a resource!
> >>> Thanks.
> >>>
> >>>
> >>>
> >>>
> >>>
> _________________________________________________________________________________
> >>> mozart-users mailing list
> >>> [email protected]
> >>> http://www.mozart-oz.org/mailman/listinfo/mozart-users
> >>
> >>
> >>
> _________________________________________________________________________________
> >> mozart-users mailing list
> >> [email protected]
> >> http://www.mozart-oz.org/mailman/listinfo/mozart-users
> >
> >
> >
> _________________________________________________________________________________
> > mozart-users mailing list
> > [email protected]
> > http://www.mozart-oz.org/mailman/listinfo/mozart-users
> >
>
> _________________________________________________________________________________
> mozart-users mailing list
> [email protected]
> http://www.mozart-oz.org/mailman/listinfo/mozart-users
>
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to