progress with futures
This commit is contained in:
parent
417b9f5a1d
commit
d2dbcf2fa4
8 changed files with 68 additions and 36 deletions
17
tests/parallel/tflowvar.nim
Normal file
17
tests/parallel/tflowvar.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
discard """
|
||||
output: '''foobarfoobarbazbearbazbear'''
|
||||
cmd: "nimrod $target --threads:on $options $file"
|
||||
"""
|
||||
|
||||
import threadpool
|
||||
|
||||
proc computeSomething(a, b: string): string = a & b & a & b
|
||||
|
||||
proc main =
|
||||
let fvA = spawn computeSomething("foo", "bar")
|
||||
let fvB = spawn computeSomething("baz", "bear")
|
||||
|
||||
echo(^fvA, ^fvB)
|
||||
|
||||
main()
|
||||
sync()
|
||||
Loading…
Add table
Add a link
Reference in a new issue