Re: [swift-users] Swift and Threads

2016-09-13 Thread Gerriet M. Denkmann via swift-users
> On 13 Sep 2016, at 14:49, Quinn The Eskimo! via swift-users > wrote: > > > On 13 Sep 2016, at 05:03, Gerriet M. Denkmann via swift-users > wrote: > >> Or is the code fundamentally wrong …? > > This one. > > You’re accessing a mutable value

Re: [swift-users] Swift and Threads

2016-09-13 Thread Quinn "The Eskimo!" via swift-users
On 13 Sep 2016, at 05:03, Gerriet M. Denkmann via swift-users wrote: > Or is the code fundamentally wrong …? This one. You’re accessing a mutable value (`bitfield`) from multiple threads. Swift does not support that, even in situations like this where you’re sure

[swift-users] Swift and Threads

2016-09-12 Thread Gerriet M. Denkmann via swift-users
This function works flawlessly in Release build: func markAndTell( talk: Bool, number: Int) { let nbrOfThreads = 8 let step = 2 let itemsPerThread = number * step let bitLimit = nbrOfThreads * itemsPerThread var bitfield = [Bool](count: bitLimit,