caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Native threads under Debian 3.0r0
@ 2002-09-03 23:03 Berke Durak
  2002-09-04  9:44 ` Markus Mottl
  2002-09-04 14:38 ` Sven LUTHER
  0 siblings, 2 replies; 11+ messages in thread
From: Berke Durak @ 2002-09-03 23:03 UTC (permalink / raw)
  To: caml-list

Hello everybody,

I'm having severe problems with native threads. Not only I can't get them to
work with the Graphics module, I can't get them to work at all. I'm
using a fresh Debian 3.0r0. I've recompiled Ocaml 3.06 with
'-with-pthread' option.  Shouldn't the following code

$ cat toto.ml
open Thread

let _ =
  let code1 () =
	let x = ref 0 in
	while true do
	  incr x;
	  Printf.printf "alpha %d\n" !x;
	  flush stdout
	done
  in
  let thread1 = Thread.create code1 ()
  in
  while true do
	()
  done

compiled with

$ ocamlopt.opt -thread unix.cmxa threads.cmxa toto.ml -o toto

and run as

$ ./toto

give me something like

alpha 0
alpha 1
alpha 2
alpha 3
alpha 4
alpha 5
alpha 6
...

?

Instead, the program doesn't output anything, and when I hit Ctrl-C,
it leaves some processes running, which can only be killed with
SIGKILL.

The program works when compiled as bytecode. System info :

$ uname -a
Linux gogol 2.4.18 #1 Thu Aug 22 20:42:28 CEST 2002 i586 unknown
$ ls -l /lib/libpthread*
-rw-r--r--    1 root     root       102172 Apr 28 11:57 /lib/libpthread-0.9.so

However, even in bytecode, when I use the Graphics module, some subprocesses
refuse to die when I interrupt the main program.

Any clues ? Thanks very much.
--
Berke Durak
-------------------
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] 11+ messages in thread

end of thread, other threads:[~2002-09-05 20:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-03 23:03 [Caml-list] Native threads under Debian 3.0r0 Berke Durak
2002-09-04  9:44 ` Markus Mottl
2002-09-04 10:15   ` Jacques Garrigue
2002-09-04 10:39     ` Olivier Andrieu
2002-09-04 13:01     ` Markus Mottl
2002-09-04 15:14       ` Berke Durak
2002-09-04 23:38         ` Jacques Garrigue
2002-09-04 14:38 ` Sven LUTHER
2002-09-05  9:17   ` Stefano Zacchiroli
2002-09-05 10:42     ` Sven LUTHER
2002-09-05 11:37       ` Stefano Zacchiroli

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