SHARE
TWEET

Untitled

a guest Dec 30th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import os
  2. import stint
  3.  
  4. proc fillseq(teste: var seq[Int128], x: int) =
  5.   for i in 1 .. x:
  6.     add(teste, i128(i))
  7.  
  8.  
  9. proc test() {.thread.} =
  10.   var teste = newSeqOfCap[Int128](1_000_000)
  11.  
  12.   fillseq(teste, 1_000_000)
  13.  
  14.   teste = newSeqOfCap[Int128](10_000)
  15.  
  16.   fillseq(teste, 10_000)
  17.  
  18.  
  19. var thr: Thread[void]
  20.  
  21. createThread(thr, test)
  22.  
  23. while running(thr):
  24.   sleep(1000)
  25.  
  26. echo "Thread halt"
  27.  
  28. while true:
  29.   sleep(1000)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top