@@ -1,8 +1,12 @@
|
|
1 |
-
procedure main
|
2 |
-
|
|
|
|
|
|
|
|
|
3 |
print "Hello from main thread"
|
4 |
end procedure
|
5 |
|
6 |
-
procedure greet
|
7 |
-
print "Hello from secondary thread"
|
8 |
end procedure
|
1 |
+
procedure main(argc, argv[])
|
2 |
+
// create thread_count as result of converting argv[1] to integer
|
3 |
+
declare thread_count := integer(argv[1])
|
4 |
+
for thread_number := 0 to thread_count do
|
5 |
+
create_thread(greet, thread_number)
|
6 |
+
end for
|
7 |
print "Hello from main thread"
|
8 |
end procedure
|
9 |
|
10 |
+
procedure greet(thread_number)
|
11 |
+
print "Hello from secondary thread", thread_number
|
12 |
end procedure
|