caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] 'global' variables
@ 2002-05-28 11:33 Animesh Pathak
  2002-05-28 11:55 ` Remi VANICAT
  0 siblings, 1 reply; 2+ messages in thread
From: Animesh Pathak @ 2002-05-28 11:33 UTC (permalink / raw)
  To: caml-list

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.

Thanks in advance
Animesh
P.S. Thanks to Michal for replying to my earlier query

-------------------
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] 'global' variables
  2002-05-28 11:33 [Caml-list] 'global' variables Animesh Pathak
@ 2002-05-28 11:55 ` Remi VANICAT
  0 siblings, 0 replies; 2+ messages in thread
From: Remi VANICAT @ 2002-05-28 11:55 UTC (permalink / raw)
  To: caml-list

Animesh Pathak <animesh.pathak@inria.fr> 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-05-28 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-28 11:33 [Caml-list] 'global' variables Animesh Pathak
2002-05-28 11:55 ` Remi VANICAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).