1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-22 11:17:40 +00:00

Remove unneeded book keeping for sub processes.

Since we are not using signals we no longer need some bookkeeping.
This commit is contained in:
Calvin Rose
2020-12-31 11:52:12 -06:00
parent c831ecf5d2
commit 788f91a36f
4 changed files with 37 additions and 69 deletions

View File

@@ -0,0 +1,22 @@
(defn dowork [name n]
(print name " starting work...")
(os/execute ["sleep" (string n)] :p)
(print name " finished work!"))
# Will be done in parallel
(print "starting group A")
(ev/call dowork "A 2" 2)
(ev/call dowork "A 1" 1)
(ev/call dowork "A 3" 3)
(ev/sleep 4)
# Will also be done in parallel
(print "starting group B")
(ev/call dowork "B 2" 2)
(ev/call dowork "B 1" 1)
(ev/call dowork "B 3" 3)
(ev/sleep 4)
(print "all work done")