You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for i := 0; i < len(imageAsBaseSixtyFour)-numberOfPixels; i++ {
dest.checksum.Add(uint32(bitmap[imageAsBaseSixtyFour[i:(i+numberOfPixels)]]))
}
dest.checksumReady = true
}`
This is run in a go routine, and later on I want to do some operation much later:
for checksumsSlice[i].checksumReady == false {}
(This waits until checksumReady == true)
checksumReady is true but highlowcontainer is nil...
Is there a way to ensure that the bitmap is valid?
Thanks!
The text was updated successfully, but these errors were encountered:
As far as I can tell from your comment, you are using unsafe Go code, and the issue you are pointing out is not related to roaring. It is important to understand what it is not because checsumReady has been set to true that the previous code has been executed. But the Go compiler and the processor will reorder or run at the same time instructions. It is not related to roaring: the same might happen with any data structure whatsoever. Even if your code may appear to work in some instance, it would still be buggy, subject to "random failures". If you want to create a data structure in one goroutine and access it safely from another goroutine, you need a strategy like stateful goroutines from the Go tutorial. There may be other valid strategies as well.
Hi!
I've noticed that this:
`func calculateBitSetChecksum(dest *checksumStruct, bitmap map[string]uint, imageAsBaseSixtyFour string, numberOfPixels int) {
}`
This is run in a go routine, and later on I want to do some operation much later:
for checksumsSlice[i].checksumReady == false {}
(This waits until checksumReady == true)
checksumReady is true but highlowcontainer is nil...
Is there a way to ensure that the bitmap is valid?
Thanks!
The text was updated successfully, but these errors were encountered: