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 2C625BB81 for ; Tue, 21 Mar 2006 02:33:26 +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 k2L1XPMG001631 for ; Tue, 21 Mar 2006 02:33:25 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA18622 for ; Tue, 21 Mar 2006 02:33:24 +0100 (MET) Received: from smtp113.sbc.mail.mud.yahoo.com (smtp113.sbc.mail.mud.yahoo.com [68.142.198.212]) by nez-perce.inria.fr (8.13.0/8.13.0) with SMTP id k2L1XNL7013982 for ; Tue, 21 Mar 2006 02:33:24 +0100 Received: (qmail 56143 invoked from network); 21 Mar 2006 01:33:15 -0000 Received: from unknown (HELO ?192.168.1.100?) (rftp@pacbell.net@69.230.226.66 with plain) by smtp113.sbc.mail.mud.yahoo.com with SMTP; 21 Mar 2006 01:33:14 -0000 Message-ID: <441F57FD.90206@rftp.com> Date: Mon, 20 Mar 2006 17:33:49 -0800 From: Robert Roessler User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060318 SeaMonkey/1.5a MIME-Version: 1.0 To: Caml-list Subject: Re: [Caml-list] Severe loss of performance due to new signal handling References: <441E760D.6010801@inria.fr> In-Reply-To: <441E760D.6010801@inria.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 441F57E5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 441F57E3.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 3.08.4:01 threads:01 assertion:01 os-dependent:01 low-level:01 dog:98 nail:98 dog:98 wrote:01 caml-list:01 short:01 assembler:02 seems:03 routines:03 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 Xavier Leroy wrote: > > It seems that changes to signal handling between OCaml 3.08.4 and 3.09.1 > > can lead to a very significant loss of performance (up to several orders > > of magnitude!) in code that uses threads and performs I/O (tested on > Linux). > > [...] > > Maybe some assembler guru can repeat this result and explain to us > > what's going on... > > Short explanation: atomic instructions are dog slow. At the risk of being "irrelevant", I wanted to nail down exactly what assertion is being made here: are we talking about directly executing in assembly code the relevant x86[-64]/ppc/whatever instructions for "read-and-clear", or going through OS-dependent access routines like Windows' InterlockedExchange()? Or: is the source of the dog slow behavior because of OS overhead, or is it a low-level issue like memory barriers/cache lines getting flushed/something else? Robert Roessler roessler@rftp.com http://www.rftp.com