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 nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 2B08FBBBC for ; Wed, 8 Mar 2006 22:14:47 +0100 (CET) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.84]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k28LEjnH007845 for ; Wed, 8 Mar 2006 22:14:46 +0100 Received: from mac.com (smtpin04-en2 [10.13.10.149]) by smtpout.mac.com (Xserve/8.12.11/smtpout08/MantshX 4.0) with ESMTP id k28LEOxt027741; Wed, 8 Mar 2006 13:14:24 -0800 (PST) Received: from [192.168.255.86] (nat.la.valueclick.com [64.70.54.15]) (authenticated bits=0) by mac.com (Xserve/smtpin04/MantshX 4.0) with ESMTP id k28LEJPp023955; Wed, 8 Mar 2006 13:14:23 -0800 (PST) In-Reply-To: References: <440DB255.1030701@asfandyar.cjb.net> <1141751708.20944.355.camel@budgie.wigram> <440DD982.8080800@asfandyar.cjb.net> <1141779125.20944.405.camel@budgie.wigram> <20060308193633.GA5460@coruscant.stwing.upenn.edu> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <658F3432-CEC8-475B-B01A-5169963A2049@mac.com> Cc: William Lovas , caml-list@yquem.inria.fr Content-Transfer-Encoding: 7bit From: Paul Snively Subject: Re: [Caml-list] STM support in OCaml Date: Wed, 8 Mar 2006 13:14:09 -0800 To: Brian Hurt X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.746.2) X-Miltered: at nez-perce with ID 440F4945.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 hash:01 popl:01 node:01 threads:01 lovas:01 posix:01 scalable:01 mutable:01 beginner's:01 ocaml:01 beginners:01 bug:01 gears:98 50,:98 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST autolearn=disabled version=3.0.3 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You folks might find Tim Sweeney's slides from POPL '06, which are linked to at , interesting. Tim gives some statistics about Gears of War, a title with about 250,000 lines of combined C++ and UnrealScript code for the title itself, and another 250,000 lines of C++ for the Unreal Engine 3, and goes on to discuss some issues that he has. For example, he has about 10,000 objects active at any given time. Whenever one of these objects is modified, it typically touches 5-10 other objects. And all of this has to happen 30-60 times per second. On slide 50, Tim talks about STM, and says: "~2-4X STM performance overhead is acceptable: if it enables our state-intensive code to scale to many threads, it's still a win." Food for thought. Best regards, Paul On Mar 8, 2006, at 12:45 PM, Brian Hurt wrote: > > > On Wed, 8 Mar 2006, William Lovas wrote: > >> As the quoted paper said, though, some running transaction can always >> commit -- so not all of the associated costs are still paid. In >> particular, the cost of potential non-termination due to deadlock or >> livelock is not paid. It doesn't matter that there's a mutex >> under the >> hood, since it's used only in such a way as to preserve the >> property that >> some transaction can always complete. > > One comment I will make is that a mutex is expensive, but not > *that* expensive. I just wrote a quick program (available if > anyone cares) in GNU C that measures the cost, in clocks, of > locking and unlocking a posix mutex. On my desktop box (AMD Athlon > XP 2200+ 1.8GHz), I'm getting a cost of like 44 clock cycles. > Which makes it less expensive than an L2 cache miss. > > At this point correctness is a much bigger concern of mine than > absolute performance. A fair bit of conservative or unnecessary > locking is acceptable, given than I can write a complicated and > highly scalable application and know that I don't have deadlocks or > livelocks. Not having race conditions would also be nice, but I > don't think that's possible with mutable data. > > Brian > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iEYEARECAAYFAkQPSSoACgkQS6yIxITC5OqqrACeK1Se7ZKbyKP9bFZSJXcoe6t/ P7IAoLr9Z/1IL2341P2ARcnMyEj+yZ1G =Lse8 -----END PGP SIGNATURE-----