In the previous snippet I forgot the `spawn`. The code below compiles, but is 
slower.
    
    
      var cnt = 0                        # count for the primes, the '1' bytes
      for i in 0..<rescnt:               # count Kn resgroups|bytes each 
restrack
          cnt += ^spawn segcount(i*KB, Kn)  <-- the '^' gets it to compile, but 
threads wait to finish
      sync()
      primecnt += cnt.uint               # update primecnt for the segm
    

Changing `0..<rescnt` to `0..rescnt-1` has same error below. Even when I do a 
`while` loop it throws the same error.
    
    
    ssozp5x1c1par.nim(156, 11) Error: type mismatch: got (uint, 
FlowVar[system.uint])
    but expected one of:
    proc `+=`[T: SomeOrdinal | uint | uint64](x: var T; y: T)
    proc `+=`[T: float | float32 | float64](x: var T; y: T)
    

The problem seems to be when `segcount` returns its output their is a type 
mismatch with `cnt` (?). 

Reply via email to