Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Fork/XPL0/fork.xpl0
Normal file
9
Task/Fork/XPL0/fork.xpl0
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
int Key, Process;
|
||||
[Key:= SharedMem(4); \allocate 4 bytes of memory common to both processes
|
||||
Process:= Fork(1); \start one child process
|
||||
case Process of
|
||||
0: [Lock(Key); Text(0, "Rosetta"); CrLf(0); Unlock(Key)]; \parent process
|
||||
1: [Lock(Key); Text(0, "Code"); CrLf(0); Unlock(Key)] \child process
|
||||
other [Lock(Key); Text(0, "Error"); CrLf(0); Unlock(Key)];
|
||||
Join(Process); \wait for child process to finish
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue