Seite 1 von 1

Clarification about Lab 2 Task 2

Verfasst: 28. Mai 2016 08:57
von salpha.2004
Hi,

What should be the output written to the file in the following cases:

1.
# ./task2.out output.txt
$ 2
2
0
$ -1
$ x

-----------------------------------

2.
# ./task2.out output.txt
$ 2
1
2
$ 1
0
$ x

Thanks in advance!

Best Regards,
Saeed

Re: Clarification about Lab 2 Task 2

Verfasst: 30. Mai 2016 11:03
von nicolas
As stated in the lab task, the file should contain all generated numbers, one per line. So the expected output would be

Code: Alles auswählen

# cat output.txt
2
0
for the first case, and

Code: Alles auswählen

# cat output.txt
1
2
0
for the second case.

In the first case, this requires the worker process to be successfully restored. Naturally, if you have not implemented checkpointing yet (as in Task 2.1) or no checkpoint is taken between the generation of the random numbers and the worker crash (possible in both Task 2.2 or 2.3, depending on the interval), your output file would instead be empty.