Skip to content

Instantly share code, notes, and snippets.

@inv2004
Last active April 13, 2020 23:33
Show Gist options
  • Save inv2004/74b7067050f3d1421e95b967f493d377 to your computer and use it in GitHub Desktop.
Save inv2004/74b7067050f3d1421e95b967f493d377 to your computer and use it in GitHub Desktop.
import tables
import threadpool
proc count(i: int): CountTable[int] =
for x in 0..i:
result.inc(x)
proc calc() =
var res = newSeq[FlowVar[CountTable[int]]](3)
for i in 0..2:
res[i] = spawn count(i)
sync()
calc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment