Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Conflicts between threads and system calls on MacOS X?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-29 (17:10)
From: mailinglists@t...
Subject: Conflicts between threads and system calls on MacOS X?

I observed a strange behavior on MacOS X, both with the native ocaml version and the macports version (latest stable ocaml version in both cases). When I compile the following file


(*ocamlopt -thread unix.cmxa threads.cmxa -o threadtest*)

ignore (Unix.system "pwd > pwd.out");;
ignore (Thread.create (fun _ -> ()) 5);;


the system call is NOT performed. However, without the last line and the same compilation commands it is working.
On Linux, it's working perfectly with the last line.

Did I do something wrong, or is it not possible to do system calls together with using threads?

By the way, the same happens with Sys.command and with Unix.create_process.

Thanks a lot in advance for help,