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
[Caml-list] Threads - how it actually works?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-06-27 (16:27)
From: Philippe Wang <>
Subject: Re: [Caml-list] Threads - how it actually works?
if you have a thread that never allocates any value in the memory heap, then
the thread may prevent the GC from working properly...

2009/6/27 Micha³ Maciejewski <>

> Hi,
> Some time ago I had some problems with threads. I had to make a
> traffic lights simulation with cars as a academic project. I decided
> to write it using ocaml with graph module and threads for timing
> (since thread pausing didn't work in the same thread that the graph
> module worked). If I remember correctly there was a loop in graph
> module thread that was drawing some objects. Another looped thread was
> changing objects positions and then was paused for some amount of time
> using (I think) Unix module. I know that wasn't a good and optimal way
> to do it, but I had only few days for it.
> Now the problem was that one of those thread never worked. It looked
> like a graph thread was using whole cpu time, and there was no context
> switching. Don't ask me to paste any code, because I dont have it. It
> was quite long time ago and I had to do my project without timing. :-)
> It was ocaml 10.*. So how threads are actually implemented in caml?
> Using some kind of timing or atomic operations?
> regards
> M
> _______________________________________________
> Caml-list mailing list. Subscription management:
> Archives:
> Beginner's list:
> Bug reports:

Philippe Wang