Re: [MacRuby-devel] GCD and NSURLConnection

2010-01-18 Thread steve ross
You're right, no ivars are being written in concurrent threads in the bug report code. However, in the NSURLConnection example, two ivars are used. The is the code to execute (the block). The second is the data buffer that will be changed as the HTTP response data returns. In either case, there

Re: [MacRuby-devel] GCD and NSURLConnection

2010-01-17 Thread Joshua Ballanco
I'd have to look at the NSURLConnection example again, but in the code from the bug report, there's no unsafe variable access in the Ruby code. Each Bar holds a reference to its own Foo in @foo, and we're dispatching to multiple Bars in turn. If you run that sample (you might need to tweak some

Re: [MacRuby-devel] GCD and NSURLConnection

2010-01-17 Thread steve ross
But... both examples show multiple threads accessing a single instance variable without taking any precautions to make the access atomic. Could it be that kind of concurrency issue? Steve On Jan 17, 2010, at 6:01 PM, Joshua Ballanco wrote: > > Hey Darin, > > Looks like you're hitting https://

Re: [MacRuby-devel] GCD and NSURLConnection

2010-01-17 Thread Joshua Ballanco
Hey Darin, Looks like you're hitting https://www.macruby.org/trac/ticket/511 Cheers, Josh On Jan 17, 2010, at 4:52 PM, Darrin Eden wrote: > Hi, > I have yet to wrap my head around GCD, but that's not stopped me from > breaking things anyway. > I'd like to use an asynchronous queue with NSU

[MacRuby-devel] GCD and NSURLConnection

2010-01-17 Thread Darrin Eden
Hi, I have yet to wrap my head around GCD, but that's not stopped me from breaking things anyway. I'd like to use an asynchronous queue with NSURLConnection. However, results in a segmentation fault. Thoughts? Thanks, -- Darrin