fixes #1646
This commit is contained in:
parent
830e0c0009
commit
b6e006fbbe
5 changed files with 32 additions and 11 deletions
22
tests/parallel/t5000.nim
Normal file
22
tests/parallel/t5000.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
output: '''50005000'''
|
||||
"""
|
||||
|
||||
import threadpool, strutils
|
||||
|
||||
proc foo(x: int): string = $x
|
||||
|
||||
proc main() =
|
||||
var a = newSeq[int]()
|
||||
for i in 1..10000:
|
||||
add(a, i)
|
||||
|
||||
var s = 0
|
||||
for i in a:
|
||||
s += parseInt(^spawn(foo(i)))
|
||||
echo s
|
||||
|
||||
setMaxPoolSize 2
|
||||
|
||||
parallel:
|
||||
spawn main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue