From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA12887; Tue, 28 May 2002 13:54:36 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA12768 for ; Tue, 28 May 2002 13:54:35 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mel-rto2.wanadoo.fr (smtp-out-2.wanadoo.fr [193.252.19.254]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4SBsZT29831 for ; Tue, 28 May 2002 13:54:35 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto2.wanadoo.fr (6.5.007) id 3CE584B2005FBA7B for caml-list@inria.fr; Tue, 28 May 2002 13:54:34 +0200 Received: from debian (80.8.82.105) by mel-rta9.wanadoo.fr (6.5.007) id 3CEE103E0020E24B for caml-list@inria.fr; Tue, 28 May 2002 13:54:34 +0200 Received: from moi by debian with local (Exim 3.35 #1 (Debian)) id 17Cfa1-0000ms-00 for ; Tue, 28 May 2002 13:55:57 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] 'global' variables References: <200205281133.g4SBXGL08926@payia.inria.fr> From: Remi VANICAT Date: Tue, 28 May 2002 13:55:57 +0200 In-Reply-To: <200205281133.g4SBXGL08926@payia.inria.fr> (Animesh Pathak's message of "Tue, 28 May 2002 13:33:16 +0200 (MET DST)") Message-ID: <87wuto1o6q.dlv@wanadoo.fr> User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Animesh Pathak writes: > dear members, > Is it possible for two threads to share data by using a global variable and > *not* giving it to a thread as an argument?? > > Please send me a small example to illustrate the same. as in : let var = "string" let f () = print_endline var; print_endline "thread" let _ = Thread.create f () let _ = print_endline var (by the way, var may be a reference, or anything). -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners