From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Fri, 04 Sep 2009 00:47:18 PDT." <3e1162e60909040047q2f3451e4k2880720beb2a1373@mail.gmail.com> References: <3e1162e60909032118h60620d2cj74791672e5f55a5f@mail.gmail.com> <0084d6ddb9d674fa38925596dabc8d78@quanstro.net> <3e1162e60909032231h5a2cc329x89744a497052e551@mail.gmail.com> <3e1162e60909032235s6e5a67dau6109f30246f255d@mail.gmail.com> <20090904071109.11C405B18@mail.bitblocks.com> <3e1162e60909040047q2f3451e4k2880720beb2a1373@mail.gmail.com> From: Bakul Shah Date: Fri, 4 Sep 2009 07:41:09 -0700 Message-Id: <20090904144110.10C345B4B@mail.bitblocks.com> Subject: Re: [9fans] "Blocks" in C Topicbox-Message-UUID: 64afa7c0-ead5-11e9-9d60-3106f5b1d025 On Fri, 04 Sep 2009 00:47:18 PDT David Leimbach wrote: > On Fri, Sep 4, 2009 at 12:11 AM, Bakul Shah > > > 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. > > > I just wrote a prime sieve with terrible shutdown synchronization you can > look at here: > > http://paste.lisp.org/display/86549 Not sure how your program invalidates what I said. Blocks do provide more syntactic sugar but that "benefit" is independent of GCD (grand central dispatch) or what have you. Given that __block vars are shared, I don't see how you can avoid locking if blocks get used in parallel.