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] Why systhreads?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhw@w...>
Subject: Re: [Caml-list] Why systhreads?
[this thread should probably migrate to]

On Monday, Nov 25, 2002, at 11:01 US/Pacific, Blair Zajac wrote:
> Xavier Leroy wrote:
>> Threads have at least three different purposes:
>> 1- Parallelism on shared-memory multiprocessors.
> [Discussion on (1), (2) and (3) removed].
> To summarize, for (2) system threads are required and and you can't
> prevent blocking with user level threads easily or at all.  For (3),
> making the Ocaml system support SMP is "Too complex; too hard to
> debug" and SMP boxes aren't all that popular.
> Aren't these contradictory statements?

Assuming you meant (1) not (3), then the answer is: No.  They're not.

> For Ocaml to support a Ocaml program to have one thread to block on a
> system call and to allow other threads to continue, doesn't this 
> support
> SMP?

Not necessarily.

> Does Ocaml support this?

No.  All threads are serialized, so an SMP machine only loads one 
processor at a time.

> I need the functionality to have multiple threads where one thread can
> block and not stop the others, either due to the OS or to the Ocaml
> runtime system.
> What am I missing here?

If I had to guess, I would say you are probably missing how your 
application is covered by case (2) or case (3) in M. LeRoy's standard 
lecture on the subject.

I've been a very long way down this road myself, and I agree with him.  
If you want your application to parallelize well, the winning design 
pattern seems to be message passing between distributed memory 

j h woodyatt <>
markets are only free to the people who own them.

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: