disjoint checker is somewhat smarter
This commit is contained in:
parent
1838ea2db4
commit
ea5217c9fc
3 changed files with 113 additions and 2 deletions
15
tests/parallel/tdont_be_stupid.nim
Normal file
15
tests/parallel/tdont_be_stupid.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
import threadpool, os
|
||||
|
||||
proc single(time: int) =
|
||||
sleep time
|
||||
echo time
|
||||
|
||||
proc sleepsort(nums: openArray[int]) =
|
||||
parallel:
|
||||
var i = 0
|
||||
while i <= len(nums) + -1:
|
||||
spawn single(nums[i])
|
||||
i += 1
|
||||
|
||||
sleepsort([50,3,40,25])
|
||||
Loading…
Add table
Add a link
Reference in a new issue