From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id A6609BBA7 for ; Wed, 8 Feb 2006 00:15:58 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k17NFwF4018736 for ; Wed, 8 Feb 2006 00:15:58 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA27550 for ; Wed, 8 Feb 2006 00:15:53 +0100 (MET) Received: from hedwig1.umh.ac.be (hedwig2.umh.ac.be [193.190.193.73]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k17NFrDh018728 for ; Wed, 8 Feb 2006 00:15:53 +0100 Received: from poincare (Debian-exim@pri-010.umh.ac.be [10.101.0.10]) by hedwig1.umh.ac.be (8.13.1/8.13.1) with ESMTP id k17NIni82453700; Wed, 8 Feb 2006 00:18:50 +0100 Received: from localhost ([127.0.0.1] ident=trch) by poincare with esmtp (Exim 4.60) (envelope-from ) id 1F6c3o-0002tV-Aw; Wed, 08 Feb 2006 00:15:48 +0100 Date: Wed, 08 Feb 2006 00:15:47 +0100 (CET) Message-Id: <20060208.001547.81488614.Christophe.Troestler@umh.ac.be> To: OCaml Mailing List Subject: How to write efficient threaded programs on OCaml From: Christophe TROESTLER X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoL KJBq0JBY9:}8v|j Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Spook: Ft. Meade North Korea Chobetsu Albanian Pine Gap FTS2000 subversive Armani underground MIT-LL X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.2.53 on Emacs 22.0.50 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at concorde with ID 43E92A2E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43E92A29.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 christophe:01 troestler:01 christophe:01 troestler:01 umh:01 ocaml:01 cheers:01 73%:98 18%:98 debian:02 debian:02 caml:02 concurrency:02 cond:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Hi, I was wondering if some among you would like to share some hints about how to write efficient multithreaded applications in OCaml. Indeed, for example, the following concurrency test shows OCaml performing quite poorly: http://shootout.alioth.debian.org/debian/benchmark.php?test=chameneos&lang=all A qprof profiling reveals that OCaml is spending 63-73% of its time on the function caml_process_pending_signals and 13-18% on pthread_cond_signal. Is there a way to improve the performance of this code ? Now maybe this is not to be considered like a good analogous of a possible "real life" application. Hence my question: what do people do to get decent performance in these cases? Cheers, ChriS