* [Caml-list] Using threads in compiled code @ 2002-04-18 7:45 Noel Welsh 2002-04-18 8:44 ` Remi VANICAT ` (4 more replies) 0 siblings, 5 replies; 15+ messages in thread From: Noel Welsh @ 2002-04-18 7:45 UTC (permalink / raw) To: caml-list Hi all, I'm writing a commercial application in O'Caml. We need to run on all the main platforms (Linux, Windows and Mac) and we'd like to use the native code compiler and threads. My first question: does O'Caml support threads in compiled code in all the above platforms? (It's ok if Mac support is pending but Windows support is essential.) My second question: how do I get threads to work? I'm currently developing on Linux and there is no threads.cmxa in my /usr/lib/ocaml (3.04 via Debian). The O'Caml book suggests I need to download and compile my own ocamlopt including pthreads support. Is this correct? What do I do for Windows? Thanks, Noel PS: Markus, I know you'll be reading this. I still prefer Scheme!!!! ;-) __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh @ 2002-04-18 8:44 ` Remi VANICAT 2002-04-18 14:44 ` Markus Mottl ` (3 subsequent siblings) 4 siblings, 0 replies; 15+ messages in thread From: Remi VANICAT @ 2002-04-18 8:44 UTC (permalink / raw) To: caml-list Noel Welsh <noelwelsh@yahoo.com> writes: > Hi all, > [...] > > My second question: how do I get threads to work? I'm > currently developing on Linux and there is no > threads.cmxa in my /usr/lib/ocaml (3.04 via Debian). > The O'Caml book suggests I need to download and > compile my own ocamlopt including pthreads support. > Is this correct? What do I do for Windows? I believe that the ocaml package on debian is already compiled with the pthread (and there is a threads.cmxa in my /usr/lib/ocaml/threads). one have to compile program with the -threads option and the the threads.cmxa library, and it should work. -- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh 2002-04-18 8:44 ` Remi VANICAT @ 2002-04-18 14:44 ` Markus Mottl 2002-04-18 17:06 ` [Caml-list] Proselytizing Charles Martin 2002-04-18 19:10 ` [Caml-list] Using threads in compiled code james woodyatt ` (2 subsequent siblings) 4 siblings, 1 reply; 15+ messages in thread From: Markus Mottl @ 2002-04-18 14:44 UTC (permalink / raw) To: Noel Welsh; +Cc: caml-list Hi Noel, long time no see! Welcome on this list! :-) On Thu, 18 Apr 2002, Noel Welsh wrote: > I'm writing a commercial application in O'Caml. Hopefully in the field of AI? > PS: Markus, I know you'll be reading this. I still > prefer Scheme!!!! ;-) Still... - but not for long if you stay on this list ;-) Only a few weeks ago I managed to convert some staunch CL-programming colleague to OCaml (after one year of merciless proselytizing!). Since then he has become a devote follower: whenever he runs into a difficult programming task now, instead of helplessly exclaiming "O God?", as he did before, he confidently prays "O'Caml!". Now I am looking for my next victim, hm... :-) Cheers, Markus -- Markus Mottl markus@oefai.at Austrian Research Institute for Artificial Intelligence http://www.oefai.at/~markus ------------------- 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] 15+ messages in thread
* [Caml-list] Proselytizing 2002-04-18 14:44 ` Markus Mottl @ 2002-04-18 17:06 ` Charles Martin 2002-04-18 20:10 ` David Chase 0 siblings, 1 reply; 15+ messages in thread From: Charles Martin @ 2002-04-18 17:06 UTC (permalink / raw) To: caml-list >Only a few weeks ago I managed to convert some staunch CL-programming >colleague to OCaml (after one year of merciless proselytizing!). I ran into some old colleagues a while back, to whom I extolled the virtues of OCaml. It turned out that "write it in ML" was a private joke between them, as in, "having trouble with that problem? write it in ML! ha ha ha" They were shocked to discover that I, an inveterate CL/Scheme devotee back in the old days, had gone over to the dark side. By the way, I scanned the new translated OCaml book and I have to say, it is a very impressive piece of work. The publication of this and Benjamin Pierce's new book might help OCaml past the inflection point. Maybe we just need to extol the "disruptive" nature of OCaml :) (http://www.stanford.edu/class/ee380/Abstracts/020424.html) Charles _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Proselytizing 2002-04-18 17:06 ` [Caml-list] Proselytizing Charles Martin @ 2002-04-18 20:10 ` David Chase 2002-04-19 2:25 ` Brian Rogoff 2002-04-19 7:58 ` Xavier Leroy 0 siblings, 2 replies; 15+ messages in thread From: David Chase @ 2002-04-18 20:10 UTC (permalink / raw) To: caml-list At 10:06 AM 4/18/2002 -0700, Charles Martin wrote: >>Only a few weeks ago I managed to convert some staunch CL-programming >>colleague to OCaml (after one year of merciless proselytizing!). >... >By the way, I scanned the new translated OCaml book and I have to say, it is a very impressive piece of work. The publication of this and Benjamin Pierce's new book might help OCaml past the inflection point. Slightly better packaging/checking on the demos would be a good thing. I am trying, as hard as possible in my non-copious free time, to get past my own inflection point, and one sticking point is confusion with CamlTk. I thought it worked -- it's clearly "here" enough to run the browser, and I did the load and execute game in the scripting window, but when I try the examples, it fails to find it: -- Making all in camltk (This program requires the CamlTk library; if you haven't installed it, compilation will fail.) make[1]: Entering directory `/h/image/ftp.inria.fr/oc/camltk' ocamlc -I +camltk -c start.ml File "start.ml", line 25, characters 0-7: Unbound module Tk make[1]: *** [start.cmo] Error 2 make[1]: Leaving directory `/h/image/ftp.inria.fr/oc/camltk' make: [all] Error 2 (ignored) I'm sure this is some sort of pilot error on my part, but it's not getting me to where I want to be. I tried to modify the makefile to use labltk instead of camltk, but it failed there with File "start.ml", line 31, characters 6-27: Expecting function has type ?name:string -> ?activebackground:Tk.color -> ?activeforeground:Tk.color -> ?anchor:Tk.anchor -> ?background:Tk.color -> ?bitmap:Tk.bitmap -> ?borderwidth:int -> ?command:(unit -> unit) -> ?cursor:Tk.cursor -> ?disabledforeground:Tk.color -> ?font:string -> ?foreground:Tk.color -> ?height:int -> ?highlightbackground:Tk.color -> ?highlightcolor:Tk.color -> ?highlightthickness:int -> ?image:[< Tk.image] -> ?justify:Tk.justification -> ?padx:int -> ?pady:int -> ?relief:Tk.relief -> ?state:Tk.state -> ?takefocus:bool -> ?text:string -> ?textvariable:Textvariable.textVariable -> ?underline:int -> ?width:int -> ?wraplength:int -> Widget.button Widget.widget I also tried to install camltk separately, but that was an almighty mess (among other things, the configuration uses obsolete macros to check for the existence of Cygwin, never mind total confusion about what tools to use to make libraries, and what suffixes different sorts of file should have.) I am doing all this on Windows 2k, with some recent version of Cygwin, and Scriptics Tcl/tk installed, and ocaml 3.04. Remember -- I am getting stumped by one of the demos that is supposed to get people started, and I am normally capable of installing garbage like Oracle, Apache, mail server software, and firewalls, all with my bare hands. Something that is supposed to be easy and confidence building, isn't. David Chase ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Proselytizing 2002-04-18 20:10 ` David Chase @ 2002-04-19 2:25 ` Brian Rogoff 2002-04-19 7:58 ` Xavier Leroy 1 sibling, 0 replies; 15+ messages in thread From: Brian Rogoff @ 2002-04-19 2:25 UTC (permalink / raw) To: David Chase; +Cc: caml-list Ouch! I filed a complaint about that very problem with the oc library camltk example. David, check out the otherlibs/labltk/example directory of your ocaml distribution, and that contains roughly the same examples for labltk. -- Brian On Thu, 18 Apr 2002, David Chase wrote: > At 10:06 AM 4/18/2002 -0700, Charles Martin wrote: > >>Only a few weeks ago I managed to convert some staunch CL-programming > >>colleague to OCaml (after one year of merciless proselytizing!). > >... > >By the way, I scanned the new translated OCaml book and I have to say, it is a very impressive piece of work. The publication of this and Benjamin Pierce's new book might help OCaml past the inflection point. > > Slightly better packaging/checking on the demos would be a good thing. > > I am trying, as hard as possible in my non-copious free time, > to get past my own inflection point, and one sticking point is > confusion with CamlTk. I thought it worked -- it's clearly > "here" enough to run the browser, and I did the load and execute > game in the scripting window, but when I try the examples, it > fails to find it: > > -- Making all in camltk > (This program requires the CamlTk library; > if you haven't installed it, compilation will fail.) > make[1]: Entering directory `/h/image/ftp.inria.fr/oc/camltk' > ocamlc -I +camltk -c start.ml > File "start.ml", line 25, characters 0-7: > Unbound module Tk > make[1]: *** [start.cmo] Error 2 > make[1]: Leaving directory `/h/image/ftp.inria.fr/oc/camltk' > make: [all] Error 2 (ignored) > > I'm sure this is some sort of pilot error on my part, but it's > not getting me to where I want to be. I tried to modify the makefile > to use labltk instead of camltk, but it failed there with > > File "start.ml", line 31, characters 6-27: > Expecting function has type > ?name:string -> > ?activebackground:Tk.color -> > ?activeforeground:Tk.color -> > ?anchor:Tk.anchor -> > ?background:Tk.color -> > ?bitmap:Tk.bitmap -> > ?borderwidth:int -> > ?command:(unit -> unit) -> > ?cursor:Tk.cursor -> > ?disabledforeground:Tk.color -> > ?font:string -> > ?foreground:Tk.color -> > ?height:int -> > ?highlightbackground:Tk.color -> > ?highlightcolor:Tk.color -> > ?highlightthickness:int -> > ?image:[< Tk.image] -> > ?justify:Tk.justification -> > ?padx:int -> > ?pady:int -> > ?relief:Tk.relief -> > ?state:Tk.state -> > ?takefocus:bool -> > ?text:string -> > ?textvariable:Textvariable.textVariable -> > ?underline:int -> > ?width:int -> ?wraplength:int -> Widget.button Widget.widget > > I also tried to install camltk separately, but that was an > almighty mess (among other things, the configuration uses > obsolete macros to check for the existence of Cygwin, never > mind total confusion about what tools to use to make libraries, > and what suffixes different sorts of file should have.) > > I am doing all this on Windows 2k, with some recent version > of Cygwin, and Scriptics Tcl/tk installed, and ocaml 3.04. > Remember -- I am getting stumped by one of the demos that > is supposed to get people started, and I am normally capable > of installing garbage like Oracle, Apache, mail server > software, and firewalls, all with my bare hands. Something > that is supposed to be easy and confidence building, isn't. > > David Chase > > > ------------------- > 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 > ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Proselytizing 2002-04-18 20:10 ` David Chase 2002-04-19 2:25 ` Brian Rogoff @ 2002-04-19 7:58 ` Xavier Leroy 2002-04-19 14:32 ` David Chase ` (2 more replies) 1 sibling, 3 replies; 15+ messages in thread From: Xavier Leroy @ 2002-04-19 7:58 UTC (permalink / raw) To: David Chase; +Cc: caml-list > I am trying, as hard as possible in my non-copious free time, > to get past my own inflection point, and one sticking point is > confusion with CamlTk. I thought it worked -- it's clearly > "here" enough to run the browser, and I did the load and execute > game in the scripting window, but when I try the examples, it > fails to find it: I agree the situation is a bit confusing: there are two OCaml GUI libraries based on Tk. One (Labltk) is part of the standard distribution, and used by the interface browser. The other (Camltk) is distributed separately and used in the demo that didn't compile. > I'm sure this is some sort of pilot error on my part, but it's > not getting me to where I want to be. I tried to modify the makefile > to use labltk instead of camltk, but it failed there with Sorry for the scary error message, but it just says that Camltk and Labltk have different interfaces! > I also tried to install camltk separately, but that was an > almighty mess (among other things, the configuration uses > obsolete macros to check for the existence of Cygwin, never > mind total confusion about what tools to use to make libraries, > and what suffixes different sorts of file should have.) > I am doing all this on Windows 2k, with some recent version > of Cygwin Camltk is (for the time being) Unix-only. Although Cygwin does heroic efforts to emulate Unix, it's not quite Unix and I'm not surprised that Camltk doesn't compile right out of the box under Cygwin. This mess should be cleaned up in the future, as there is an effort in progress to merge Labltk and Camltk, and install both in the standard distribution. In the meantime, I agree a Labltk version of the examples is in order. > Remember -- I am getting stumped by one of the demos that > is supposed to get people started, and I am normally capable > of installing garbage like Oracle, Apache, mail server > software, and firewalls, all with my bare hands. I don't doubt that, but my experience (as a long-time Unix user who installed quite a bit of garbage of the kind you mention) is that installing Unix software on Windows machines, even with Cygwin, is often surprisingly hard. - Xavier Leroy ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Proselytizing 2002-04-19 7:58 ` Xavier Leroy @ 2002-04-19 14:32 ` David Chase 2002-04-19 15:21 ` Sven 2002-04-22 8:38 ` [Caml-list] CamlTk/Windows Christophe Macabiau 2 siblings, 0 replies; 15+ messages in thread From: David Chase @ 2002-04-19 14:32 UTC (permalink / raw) To: caml-list At 09:58 AM 4/19/2002 +0200, Xavier Leroy wrote: >I don't doubt that, but my experience (as a long-time Unix user who >installed quite a bit of garbage of the kind you mention) is that >installing Unix software on Windows machines, even with Cygwin, is >often surprisingly hard. True, though Cygwin has improved astonishingly over the last five years. One problem with the "new" Cygwin is that it comes in many, many pieces, so when someone says "Cygwin" you cannot now be sure what exactly they have installed. However, back to the subject. For proselytizing purposes, you want to avoid bad surprises for new users. In this case, I think that means that you should remove any Unix-only demos from the introductory examples, and put them someplace with a clear label that says "Unix only". Unless the benefits from impressing the Unix users outweigh the negatives of confusing the Windows users, such demos should go. The other reason to avoid Unix-only demos is that, if you wish to make ocaml more likely to be accepted by new users, then it doesn't hurt to be "cross platform", which means that support for Windows is about as good as support for Unix (which ought to now include MacOS X). Not only should this be true, it should also be easy to see this truth from the outside. This is purely for marketing purposes, understand, but I am much more likely to want to write something new in OCaml if I think I'll be able to run it on any box I am likely to use (meaning, Windows, Linux, and MacOS). David ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Proselytizing 2002-04-19 7:58 ` Xavier Leroy 2002-04-19 14:32 ` David Chase @ 2002-04-19 15:21 ` Sven 2002-04-22 8:38 ` [Caml-list] CamlTk/Windows Christophe Macabiau 2 siblings, 0 replies; 15+ messages in thread From: Sven @ 2002-04-19 15:21 UTC (permalink / raw) To: Xavier Leroy; +Cc: David Chase, caml-list On Fri, Apr 19, 2002 at 09:58:44AM +0200, Xavier Leroy wrote: > > I also tried to install camltk separately, but that was an > > almighty mess (among other things, the configuration uses > > obsolete macros to check for the existence of Cygwin, never > > mind total confusion about what tools to use to make libraries, > > and what suffixes different sorts of file should have.) > > I am doing all this on Windows 2k, with some recent version > > of Cygwin > > Camltk is (for the time being) Unix-only. Although Cygwin does heroic > efforts to emulate Unix, it's not quite Unix and I'm not surprised > that Camltk doesn't compile right out of the box under Cygwin. So no ActiveDvi for windows, isn't it ? That it until the next release of ocaml at least. > I don't doubt that, but my experience (as a long-time Unix user who > installed quite a bit of garbage of the kind you mention) is that > installing Unix software on Windows machines, even with Cygwin, is > often surprisingly hard. Ok, i will stop trying to build camltk and advi on a windows box then, and use my time more positively. Friendly, Sven Luther ------------------- 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] 15+ messages in thread
* [Caml-list] CamlTk/Windows 2002-04-19 7:58 ` Xavier Leroy 2002-04-19 14:32 ` David Chase 2002-04-19 15:21 ` Sven @ 2002-04-22 8:38 ` Christophe Macabiau 2 siblings, 0 replies; 15+ messages in thread From: Christophe Macabiau @ 2002-04-22 8:38 UTC (permalink / raw) To: Xavier Leroy, caml-list Cc: David Chase, Sven, Pierre.weis, jun.furuse, Dmitry Bely, fukuzawa Xavier Leroy wrote: > Camltk is (for the time being) Unix-only. Although Cygwin does heroic > efforts to emulate Unix, it's not quite Unix and I'm not surprised > that Camltk doesn't compile right out of the box under Cygwin. CamlTk compiles under Windows ! You can have a look at SynDEx, which is written using CamlTk : http://www-rocq.inria.fr/syndex/ It's true that it's a little difficult to compile with Cygwin, various reasons : * you don't have the good version of Cygwin; I use the version 1.1.8-2 (one day I tried another version unsucessfully) * maybe you have a problem with the configure script; in this case you must report to Pierre Weis and Jun Furuse who maintain CamlTk. SynDEx is written with CamlTk, but no depends on cygwin.dll. Dmitry Bely and Masakazu Fukuzawa made a patch of OCaml-3.03 to compile OCaml with mingw (http://www.mingw.org/ ) which allows to compile under windows without to rely on 3rd party DLL; instead of using cygwin.dll, it use Microsoft's standard C runtime library MSVCRT.DLL. We adapted this patch to the version 3.04 of OCaml. That's what I use to compile SynDEx. We have discussed with the Ocaml team to include this patch in the next version of Ocaml, to be able to compile with mingw; I don't know if they took a decision... Maybe it would be useful to distribute this patch on the Camltk web ? It would be great for Ocaml users who work under Windows (it's not a shame) to be allowed to use Camltk (it's a joke...) Regards Christophe Macabiau ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh 2002-04-18 8:44 ` Remi VANICAT 2002-04-18 14:44 ` Markus Mottl @ 2002-04-18 19:10 ` james woodyatt 2002-04-18 21:05 ` Oliver Bandel 2002-04-19 7:42 ` Xavier Leroy 4 siblings, 0 replies; 15+ messages in thread From: james woodyatt @ 2002-04-18 19:10 UTC (permalink / raw) To: Noel Welsh; +Cc: caml-list On Thursday, April 18, 2002, at 12:45 AM, Noel Welsh wrote: > > My first question: does O'Caml support threads in > compiled code in all the above platforms? (It's ok if > Mac support is pending but Windows support is > essential.) Thread support in native code on Mac OS X is basically not there. That's because the POSIX threads library in Mac OS X 10.1 is insufficiently featureful. I'm told by reliable source that the POSIX thread support in the next version of Mac OS X will be much improved. Whether and when that meanders its way into a working Ocaml kit is a hard guess. -- j h woodyatt <jhw@wetware.com> ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh ` (2 preceding siblings ...) 2002-04-18 19:10 ` [Caml-list] Using threads in compiled code james woodyatt @ 2002-04-18 21:05 ` Oliver Bandel 2002-04-19 7:42 ` Xavier Leroy 4 siblings, 0 replies; 15+ messages in thread From: Oliver Bandel @ 2002-04-18 21:05 UTC (permalink / raw) To: Noel Welsh; +Cc: caml-list On Thu, 18 Apr 2002, Noel Welsh wrote: > Hi all, > > I'm writing a commercial application in O'Caml. [...] Dear Audience, lets invest some minutes and sing a song... "OH HAPPY DAY, OH HAPPY DAAAY,...." Ciao, Oliver ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh ` (3 preceding siblings ...) 2002-04-18 21:05 ` Oliver Bandel @ 2002-04-19 7:42 ` Xavier Leroy 2002-04-19 16:09 ` John Max Skaller 2002-04-23 13:16 ` Noel Welsh 4 siblings, 2 replies; 15+ messages in thread From: Xavier Leroy @ 2002-04-19 7:42 UTC (permalink / raw) To: Noel Welsh; +Cc: caml-list > I'm writing a commercial application in O'Caml. We > need to run on all the main platforms (Linux, Windows > and Mac) and we'd like to use the native code compiler > and threads. > > My first question: does O'Caml support threads in > compiled code in all the above platforms? Linux: yes. Windows: yes. Mac: not yet by lack of (full) POSIX threads, but it is likely that future versions of MacOS X will have it. > My second question: how do I get threads to work? I'm > currently developing on Linux and there is no > threads.cmxa in my /usr/lib/ocaml (3.04 via Debian). > The O'Caml book suggests I need to download and > compile my own ocamlopt including pthreads support. > Is this correct? Yes. There is a configuration-time choice between bytecode-only threads and system threads (pthreads). Depending on what the author of the OCaml package chose, you may have to recompile from sources and select system threads. > What do I do for Windows? Nothing! The Windows port of OCaml uses system (Win32) threads, both in bytecode and native-code. Keep us informed with your commercial application. - Xavier Leroy ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-19 7:42 ` Xavier Leroy @ 2002-04-19 16:09 ` John Max Skaller 2002-04-23 13:16 ` Noel Welsh 1 sibling, 0 replies; 15+ messages in thread From: John Max Skaller @ 2002-04-19 16:09 UTC (permalink / raw) To: Xavier Leroy; +Cc: Noel Welsh, caml-list If you're using threads with sockets, you might want to do what I did: I took the library routine that launches a process on a connect [establish_server .. seems to be defunct now ..] and replaced enough code to make it launch a thread instead. I used the John Reppy style channels from the Threads library Event module for communication. My application was designed to provide an simulation of a telephone system. Getting the logic and timing right was very tricky -- coding it in Ocaml was very easy, those Reppy channel things are magic. The hardest part was managing termination .. [I'd never written a serious multithreaded app before .. Stevens + Ocaml makes a fine team :-] BTW: if you're looking at mobile agents .. JoCaml is worth examining... in fact, its worth examining even if you're not :-) -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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] 15+ messages in thread
* Re: [Caml-list] Using threads in compiled code 2002-04-19 7:42 ` Xavier Leroy 2002-04-19 16:09 ` John Max Skaller @ 2002-04-23 13:16 ` Noel Welsh 1 sibling, 0 replies; 15+ messages in thread From: Noel Welsh @ 2002-04-23 13:16 UTC (permalink / raw) To: caml-list My thanks to everyone who responded to my question. I looks like O'Caml has the level of support we desire. As soon as I get time to recompile my O'Caml installation I'll see how I get on with pthreads. Noel __________________________________________________ Do You Yahoo!? Yahoo! Games - play chess, backgammon, pool and more http://games.yahoo.com/ ------------------- 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] 15+ messages in thread
end of thread, other threads:[~2002-04-23 13:48 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2002-04-18 7:45 [Caml-list] Using threads in compiled code Noel Welsh 2002-04-18 8:44 ` Remi VANICAT 2002-04-18 14:44 ` Markus Mottl 2002-04-18 17:06 ` [Caml-list] Proselytizing Charles Martin 2002-04-18 20:10 ` David Chase 2002-04-19 2:25 ` Brian Rogoff 2002-04-19 7:58 ` Xavier Leroy 2002-04-19 14:32 ` David Chase 2002-04-19 15:21 ` Sven 2002-04-22 8:38 ` [Caml-list] CamlTk/Windows Christophe Macabiau 2002-04-18 19:10 ` [Caml-list] Using threads in compiled code james woodyatt 2002-04-18 21:05 ` Oliver Bandel 2002-04-19 7:42 ` Xavier Leroy 2002-04-19 16:09 ` John Max Skaller 2002-04-23 13:16 ` Noel Welsh
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox