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
thousands of CPU cores
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-07-10 (22:39)
From: Gerd Stolpmann <info@g...>
Subject: Re: [Caml-list] Re: thousands of CPU cores

Am Donnerstag, den 10.07.2008, 22:35 +0100 schrieb Jon Harrop:
> On Thursday 10 July 2008 22:19:05 Gerd Stolpmann wrote:
> > After having ported godi to mingw I am not sure whether this works at
> > all. The point is that you usually want to inherit OS resources to the
> > child process (e.g. sockets). The CreateProcess Win32 call
> > (http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx) mentions
> > that you can inherit handles, but I would be careful with the
> > information given in MSDN. Often it works only as far as the presented
> > examples. Windows isn't written for multi-processing, and its syscalls
> > aren't as orthogonal as in Unix-type systems.
> >
> > Furthermore, it looks like a pain in the ass - often you want to run
> > some initialization code, and without fork() you have to run it as often
> > as you start processes.
> >
> > Also, Windows is just a bad platform for event-based programs, and you
> > want to do it to some extent (e.g. for watching all your child
> > processes). Only for socket handles there is a select() call. For all
> > other types of handles you cannot find out in advance whether the
> > operation would block or not.
> >
> > So... if there is any chance you can select the OS, keep away from
> > Windows for this type of program.
> I think your conclusion needs qualification.
> You are trying to shoehorn an existing process-based Linux solution onto 
> Windows and discovering that it does not work well. However, Windows already 
> provides different ways of achieving the same thing, e.g. F# with its 
> first-class events and built-in asynchronous programming syntax using 
> the .NET thread pool and mailboxes for message passing.
> Moreover, the idiomatic solution on Windows is almost certainly faster than 
> anything you can reasonably write under Linux in the absence of a concurrent 
> GC (i.e. off the JVM).

You are right, this is pretty much incomparable. MS has its own way of
doing things, making it hard to write portable code. I mean other OS
vendors managed to jump on the POSIX train.

We should stop here, it's getting off-topic.

Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714