Add tasks for all the new languages

This commit is contained in:
Tina Müller 2016-12-05 23:44:36 +01:00
parent 9dc3c2bb62
commit bba7bfd280
13208 changed files with 134745 additions and 0 deletions

5
Task/Fork/LFE/fork.lfe Normal file
View file

@ -0,0 +1,5 @@
(defun start ()
(spawn (lambda () (child))))
(defun child ()
(lfe_io:format "This is the new process~n" '()))

View file

@ -0,0 +1,15 @@
local(mydata = 'I am data one')
split_thread => {
loop(2) => {
sleep(2000)
stdoutnl(#mydata)
#mydata = 'Oh, looks like I am in a new thread'
}
}
loop(2) => {
sleep(3000)
stdoutnl(#mydata)
#mydata = 'Aha, I am still in the original thread'
}

11
Task/Fork/Nim/fork.nim Normal file
View file

@ -0,0 +1,11 @@
import posix
var pid = fork()
if pid < 0:
# error forking a child
elif pid > 0:
# parent, and pid is process id of child
else:
# child
quit()
# further Parent stuff here

View file

@ -0,0 +1,8 @@
procedure mythread()
?"mythread"
exit_thread(0)
end procedure
atom hThread = create_thread(routine_id("mythread"),{})
?"main carries on"
wait_thread(hThread)

View file

@ -0,0 +1 @@
system("calc")

View file

@ -0,0 +1,3 @@
var x = 42;
{ x += 1; say x }.fork.wait; # x is 43 here
say x; # but here is still 42

3
Task/Fork/Wart/fork.wart Normal file
View file

@ -0,0 +1,3 @@
do (fork sleep.1
prn.1)
prn.2