From: "Török Edwin" <edwintorok@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Multi-threaded programs using MinGW x-compiler
Date: Mon, 24 May 2010 15:22:48 +0300 [thread overview]
Message-ID: <4BFA6F98.4050205@gmail.com> (raw)
In-Reply-To: <2EB36A07AAE8C44BBB1986425E7A22D00FF060AD0D@atp-mbx1.in.nicta.com.au>
On 2010-05-24 04:39, Paul Steckler wrote:
> Has anyone gotten an OCaml multithreaded program to build for Win32 native threads using the
> MinGW ocaml cross-compiler?
I'm not a windows user, but I tried with Debian's mingw32-ocaml package
and wine: it seems to work. I don't know if it uses native threads or
not, but it does import CreateThread.
Here is what I did:
$ cat >x.ml <<EOF
let f_proc1 () = for i=0 to 10 do Printf.printf "(%d)" i; flush stdout done;
print_newline() ;;
let t1 = Thread.create f_proc1 () ;;
Thread.join t1 ;;
EOF
$ i586-mingw32msvc-ocamlopt -thread unix.cmxa threads.cmxa x.ml
$ WINEDEBUG=-all wine camlprog.exe
(0)(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)
$ i586-mingw32msvc-nm camlprog.exe |grep Thread
0042da60 T _CreateThread@24
0042daa0 T _GetCurrentThread@0
0044f3b4 I __imp__CreateThread@24
0044f3e0 I __imp__GetCurrentThread@0
0042ec9c D _camlThread
0042ef98 D _camlThreadUnix
....
Best regards,
--Edwin
prev parent reply other threads:[~2010-05-24 12:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-24 1:39 Paul Steckler
2010-05-24 10:03 ` Richard W.M. Jones
2010-05-24 12:22 ` Török Edwin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BFA6F98.4050205@gmail.com \
--to=edwintorok@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox