From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain Date: Thu, 3 Sep 2009 15:36:20 -0700 From: Roman V Shaposhnik In-reply-to: <9ec1e4e59a6d111588ad2a506f1bb5e2@quanstro.net> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-id: <1252017380.16936.5222.camel@work.SFBay.Sun.COM> References: <9ec1e4e59a6d111588ad2a506f1bb5e2@quanstro.net> Subject: Re: [9fans] "Blocks" in C Topicbox-Message-UUID: 635bbb02-ead5-11e9-9d60-3106f5b1d025 On Thu, 2009-09-03 at 17:35 -0400, erik quanstrom wrote: > On Thu Sep 3 17:09:01 EDT 2009, rvs@sun.com wrote: > > Anything can be done using regular C and threads. The trick here > > is to make everything *scalable* and *painless* enough so that > > mere mortals can start benefiting from parallelism in their code. > > > > The other trick here is to find a model that makes things *natural*, and > > that means practically no explicit locking, less shared state, etc. > > > > The search for the model is meaningless unless it is used for > > solving *practical* challenges. In that respect, one of my > > favorite article is how implementation of a chess engine > > influenced Cilk framework (which almost has the notion of a "block") > > http://supertech.csail.mit.edu/papers/icca99.pdf > > > > Read it, I don't think we can be on the same page (and escape the > > armchair philosophy trap) unless we are talking about practical > > applications of the framework. > > > > Look at the chess example -- can the same be done with pure C? Sure! > > Did Cilk make it less painful? Absolutely! > > my question was, what's naming your function pointers > or not got to do with locking? i'm asking about the language > construct, not the library er i mean "framework" and maybe runtime > that goes with it. It has nothing to do with locking. You are correct. However, the style of programming that it allows lets you build lock-free computations much more *elegantly*. I use the word elegantly on purpose here. Since the discussion is already in the personal taste territory all I can do to back my claim is to note that regardless of whether blocks are closures or not (they are not) they are true lambdas. Are lambdas useful? I sure think so, but I don't think I can convince you by any other means except for offering links to "LAMBDA the ultimate..." set of articles: http://library.readscheme.org/page1.html Thanks, Roman.