disjoint checker is somewhat smarter

This commit is contained in:
Araq
2015-03-15 00:54:09 +01:00
parent 1838ea2db4
commit ea5217c9fc
3 changed files with 113 additions and 2 deletions

View 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])