On Thu, 2009-09-03 at 15:36 -0400, erik quanstrom wrote:
> > > > Apple's using it all over the place in Snow Leopard, in all their native
> > > > apps to write cleaner, less manual-lock code.  At least, that's the 
> > > > claim
> > > > :-).
> > >
> > > could someone explain this to me?  i'm just missing how
> > > naming a block of code could change its locking properties.
> > >
> > >
> > The explanation is in the manual I linked to earlier in this discussion.  If
> > you want to see examples there's two I can think of available for download.
> >  One is called DispatchLife the other is DispatchFractal.
> > 
> > I've looked at DispatchLife, and there's no explicit locking of state for
> > every cell being concurrently update in Conway's game of life.
> 
> i can't find DispatchLife after a few minutes of googling.
> i've read the manual, and it looks like csp to me.  clearly
> i am a reprobate outside the apple reality distortion field.
> 
> could you explain why this isn't csp 

Please define what is it that you refer to as csp. The reason
I'm asking is simple: csp-like things are needed but *not*
sufficient for implementing a nice abstraction for the 
parallel framework.

> and why this can't be done
> with regular c (that is why we need the concept of an
> unnamed function pointer) and the thread library?

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!

Thanks,
Roman.


Reply via email to