From: Stas B. <sta...@gm...> - 2014-02-19 17:20:44
|
james anderson <jam...@se...> writes: > good evening; > > On 18 Feb 2014, at 8:19 AM, Stas Boukarev wrote: > >> Siebe de Vos <Si...@de...> writes: >> >>> Hi, >>> ... >>> This would be a simple test: >>> >>> (let ((shared (cons t nil))) >>> (sb-thread:make-thread (lambda () >>> (loop >>> (let ((cons (cons nil nil))) >>> (setf (car cons) t >>> shared cons))))) >>> (sb-thread:make-thread (lambda () >>> (loop >>> (assert (consp shared) >>> () "#'cons needs a barrier!") >>> (assert (car shared) >>> () "(setf car) needs a barrier!"))))) >>> >>> Can it fail on SBCL? >> It does fail on PPC. > > the second assertion or the first? > if the second, because the car value was nil? > if so, is it correct to infer that the ppc memory is sufficiently > incoherent, that the reading thread sees the write to the 'shared' > binding before the write to the car? > if so, does the behavior change if the mutation is wrapped in a function? > > (i would endeavor to answer the questions myself, but have been unable > to build a threaded sbcl on my available ppc host...) The second one, allocation was fixed recently to insert SYNC. -- With best regards, Stas. |