-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShosho.mis
More file actions
35 lines (35 loc) · 765 Bytes
/
Shosho.mis
File metadata and controls
35 lines (35 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
VAR $mystring, STRING,100,"Hello world MIS:"
VAR $counter1,NUMERIC,0
VAR $counter2,NUMERIC,0
VAR $counter3,NUMERIC,0
VAR $sleep1,NUMERIC,0
VAR $sleep2,NUMERIC,0
VAR $sleep3,NUMERIC,0
ASSIGN $counter1,10
ASSIGN $counter2,20
ASSIGN $counter3,30
ASSIGN $sleep1,3
ASSIGN $sleep2,2
ASSIGN $sleep3,1
THREAD_BEGIN
LABEL LOOP1
OUT $mystring,$counter1
SUB $counter1,$counter1,1
SLEEP $sleep1
JMPNZ LOOP1,$counter1
THREAD_END
OUT "Forked Threads and will sleep on Barrier\n"
THREAD_BEGIN
LABEL LOOP2
OUT "Thread 2: ",$mystring,$counter2," !!\n"
SUB $counter2,$counter2,1
SLEEP $sleep2
JMPNZ LOOP1,$counter2
THREAD_END
THREAD_BEGIN
LABEL LOOP3
OUT "Thread 3: ",$mystring,$counter3," !!\n"
SUB $counter3,$counter3,1
SLEEP $sleep3
JMPNZ LOOP3,$counter3
THREAD_END