From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3e1162e60909031250v2914ab29s6e43e371f896712b@mail.gmail.com> References: <3e1162e60909031213k5209f296vb0a77ff858e45496@mail.gmail.com> <580135a14ad078bb8223e7c448a5fa2b@quanstro.net> <3e1162e60909031250v2914ab29s6e43e371f896712b@mail.gmail.com> Date: Mon, 7 Sep 2009 00:35:16 +0200 Message-ID: <5d375e920909061535u6d0180c8o5032c0afea1acf23@mail.gmail.com> From: Uriel To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] "Blocks" in C Topicbox-Message-UUID: 6717e41e-ead5-11e9-9d60-3106f5b1d025 On Thu, Sep 3, 2009 at 9:50 PM, David Leimbach wrote: > > > On Thu, Sep 3, 2009 at 12:36 PM, 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. =C2=A0At least, that= 's the >> > > > claim >> > > > :-). >> > > >> > > could someone explain this to me? =C2=A0i'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 discussio= n. >> > =C2=A0If >> > you want to see examples there's two I can think of available for >> > download. >> > =C2=A0One 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. =C2=A0clearly >> i am a reprobate outside the apple reality distortion field. >> > > Google doesn't have all the answers, I actually had to use Bing today, an= d > it worked... anyway here's the link to DispatchLife. > http://developer.apple.com/mac/library/samplecode/DispatchLife/ > >> >> could you explain why this isn't csp 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? > > I'm actually planning to figure this stuff out a bit more and "blog" abou= t > it, hopefully by Friday sometime (tomorrow). > I don't agree that any of this stuff is strictly needed. =C2=A0One can pl= od along > with pthreads and do it wrong all day. =C2=A0One doesn't *need* C either,= I've What do pthreads have to do with anything? Ever heard of libthread, libtask and rfork? I guess not, Apple certainly hasn't, and they sure are doing a great job at making their developers keep track of as much Apple-induced crap as possible... uriel > seen whole OSes for x86 written in assembly. > It all depends on how much crap you want to keep track of. > Dave > >> >> - erik >> > >