English version
Accueil propos Tlchargement Ressources Contactez-nous

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

Browse thread
Threads performance issue.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-17 (13:52)
From: Frédéric Gava <gava@u...>
Subject: Re: [Caml-list] Re: Threads performance issue.
>> I would like to read two files in two different threads.
>> I have made a first version reading the first then the second and it takes
>> 2.8s (native).
>> I decided to make a threaded version and before any use of thread I realize=
>> d
>> that just linking no even using it to the threads library makes my first
>> version of the program to run in 12s !

This kind of trick can work when files are on different discs due to two 
I/O calls (even using blocking reading). But in a single thread using 
non-blocking reading should also work but it is more difficult to write.