[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: objets distribues
- To: David Chemouil <David.Chemouil@enseeiht.fr>
- Subject: Re: objets distribues
- From: Alan Schmitt <alan.schmitt@inria.fr>
- Date: Mon, 11 Sep 2000 15:26:38 +0200
- Cc: jocaml@inria.fr
- Content-Disposition: inline
- In-Reply-To: <39BCB045.6C34D516@enseeiht.fr>; from David.Chemouil@enseeiht.fr on Mon, Sep 11, 2000 at 12:13:25PM +0200
- Mail-Followup-To: David Chemouil <David.Chemouil@enseeiht.fr>,jocaml@inria.fr
- Organization: INRIA Rocquencourt
- References: <39BCA2DC.452ACF4F@enseeiht.fr> <20000911113044.A3887@alan-schm1p.inria.fr> <39BCB045.6C34D516@enseeiht.fr>
- User-Agent: Mutt/1.2i
Salut,
>
>Re-bonjour,
..
>si j'ai un objet [o], avec une methode [m], et que
>cet objet est connu par deux autres objets [o1] et [o2], que se
>passe-t-il si [o1] et [o2] appellent [o#m] en meme temps? Cette methode
>sera-t-elle appelee automatiquement en exclusion mutuelle, ou dois-je
>gerer un mutex a l'interieur de [o]?
>
>
>Cordialement,
>
>dc
>
>--
>David Chemouil [mailto:chemouil@enseeiht.fr] [mobile: 06 84 16 26 65]
>
>Laboratoire d'informatique et de mathématiques appliquées (IRIT-INPT)
Voici un exemple (de Sylvain Conchon) qui montre ce qui se passe (les
méthodes sont bien appelées de manière concurrente):
# class t () =
method g s =
print_string s;
print_newline();
Thread.delay(10.);
print_string (s^"... fin\n");
flush stdout
end;;
class t (unit) = method g : string -> unit end
# let o = new t() in
spawn{ {(o#g("appel :1"));} | {(o#g("appel :2"));} } ;;
- : unit = ()
appel :1
appel :2
appel :2... fin
appel :1... fin
Amicalement,
Alan Schmitt
--
The hacker: someone who figured things out and made something cool happen.