On Fri, Sep 4, 2009 at 5:14 AM, erik quanstrom <quanstro@quanstro.net> wrote:
> But this has no more to do with parallelism than any other
> feature of C. If you used __block vars in a block, you'd
> still need to lock them when the block is called from
> different threads.

that's a lot worse than a function pointer.  with
a function pointer your going to get unique space
on the stack for each invocation.

Unless the variable is static right?  And not automatic?  So __block is the block's static local data?

I could be wrong, but I feel like you're not really interested in entertaining that this idea could be useful, but more interested in shooting it down.  That's fine, people do that all the time.  People are *constantly* saying Plan 9 is a huge waste of time too.  And if you count the number of actual users, they're probably right.

I happen to like Plan 9, so I do some stuff with it.  I don't know if I like libdispatch, GCD or these new C closures yet.  I am finding myself wanting to try to like them, but I can't decide yet how bad or good they really are.

Deep down inside, I want people to stop trying to code stuff like this in C and try the massively scaled parallelism/concurrency stuff in other languages better suited to the problem space.  
 

the variable capture thing seems to me to just
confuse the issue.  c doesn't otherwise work
like that.

And now you've arrived at the conclusion apple probably arrived at for changing the language the way they did.  C doesn't otherwise work like that :-)

Note I've written a concurrent prime sieve with these facilities.

http://paste.lisp.org/display/86549

I should also note that once I crank max up a little over 700 it all seems to fall apart.

This might be my bug, or apple's bug.  But I've been really good at finding bugs in apple's new features for years now.  I totally froze up a system playing with kernel queues when they added them at first too, and they contacted me personally to retry my code when they thought they had it fixed.  

They may come off as pompous, but I know people in apple looking for people to examine this stuff in a serious way, and give feedback.  

Dave

 

- erik