caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] newby using Thread on windows (different than linux)...
@ 2002-03-06  5:24 Oliver George (Boyer)
  2002-03-06 10:23 ` mattwb
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver George (Boyer) @ 2002-03-06  5:24 UTC (permalink / raw)
  To: 'caml-list@inria.fr'

Hi,

This is my first ocaml script but i don't think i've done anything silly...

(* My first ocaml program!  identifies a thread problem.
 * build with: 
 *   ocamlc -thread unix.cma threads.cma threadtest.ml -o threadtest.exe
 *)
Printf.printf "one\n";
Thread.delay 1.0;
Printf.printf "two\n";
Thread.delay 1.0;
Printf.printf "three\n";

This script works on my debian/testing server but will bomb out on windows
nt running ocaml 3.04.  It bombs out at the first Thread.delay statement,
quietly and without error...

On windows:
========
C:\data\cp>ocamlc -thread unix.cma threads.cma cp.ml -o cp.exe

C:\data\cp>cp.exe

C:\data\cp>
========

On Linux:
========
opgeorge@bywdeb002:~/tmp$ ocamlc -thread unix.cma threads.cma threadtest.ml
-o test
opgeorge@bywdeb002:~/tmp$ ./test
one
two
three
opgeorge@bywdeb002:~/tmp$
========


Can anyone tell me what i'm doing wrong... 

thanks, 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] 2+ messages in thread

* Re: [Caml-list] newby using Thread on windows (different than linux)...
  2002-03-06  5:24 [Caml-list] newby using Thread on windows (different than linux) Oliver George (Boyer)
@ 2002-03-06 10:23 ` mattwb
  0 siblings, 0 replies; 2+ messages in thread
From: mattwb @ 2002-03-06 10:23 UTC (permalink / raw)
  To: Oliver.George; +Cc: caml-list


>This script works on my debian/testing server but will bomb out on windows
>nt running ocaml 3.04.  It bombs out at the first Thread.delay statement,
>quietly and without error...

The problem is on +ocaml-3.04/otherlibs/systhreads/thread_win32.ml
Line 54:



     let preempt signal = yield()



Can be changed to 



    let preempt signal = 
      if not (!Sys.interactive && signal=(-11)) then
        yield()



On the surface, this appears to work, but I cannot guarantee that
this will not cause any negative consequences in other situations.
-------------------
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-03-07  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06  5:24 [Caml-list] newby using Thread on windows (different than linux) Oliver George (Boyer)
2002-03-06 10:23 ` mattwb

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