Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Concurrent-computing/Pike/concurrent-computing-1.pike
Normal file
11
Task/Concurrent-computing/Pike/concurrent-computing-1.pike
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
int main() {
|
||||
// Start threads and wait for them to finish
|
||||
({
|
||||
Thread.Thread(write, "Enjoy\n"),
|
||||
Thread.Thread(write, "Rosetta\n"),
|
||||
Thread.Thread(write, "Code\n")
|
||||
})->wait();
|
||||
|
||||
// Exit program
|
||||
exit(0);
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
int main(int argc, array argv)
|
||||
{
|
||||
call_out(write, random(1.0), "Enjoy\n");
|
||||
call_out(write, random(1.0), "Rosetta\n");
|
||||
call_out(write, random(1.0), "Code\n");
|
||||
call_out(exit, 1, 0);
|
||||
return -1; // return -1 starts the backend which makes Pike run until exit() is called.
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue