Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
5
Task/Fork/LFE/fork.lfe
Normal file
5
Task/Fork/LFE/fork.lfe
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
(defun start ()
|
||||
(spawn (lambda () (child))))
|
||||
|
||||
(defun child ()
|
||||
(lfe_io:format "This is the new process~n" '()))
|
||||
15
Task/Fork/Lasso/fork.lasso
Normal file
15
Task/Fork/Lasso/fork.lasso
Normal 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
11
Task/Fork/Nim/fork.nim
Normal 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
|
||||
8
Task/Fork/Phix/fork-1.phix
Normal file
8
Task/Fork/Phix/fork-1.phix
Normal 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)
|
||||
1
Task/Fork/Phix/fork-2.phix
Normal file
1
Task/Fork/Phix/fork-2.phix
Normal file
|
|
@ -0,0 +1 @@
|
|||
system("calc")
|
||||
3
Task/Fork/Sidef/fork.sidef
Normal file
3
Task/Fork/Sidef/fork.sidef
Normal 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
3
Task/Fork/Wart/fork.wart
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
do (fork sleep.1
|
||||
prn.1)
|
||||
prn.2
|
||||
Loading…
Add table
Add a link
Reference in a new issue