English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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 test.ml:


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

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,