21.01.2014 Views

Lab 3 - IDA

Lab 3 - IDA

Lab 3 - IDA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Lab</strong> 4: Final Tests<br />

• For testing your readers-writers algorithm, we<br />

provide the following user programs: pfs.c,<br />

pfs_reader.c, pfs_writer.c<br />

• These programs emulate several readers and writers<br />

accessing the same file.<br />

– 2 Writers: repeatedly fill file.1 with a letter (new<br />

letter each time).<br />

– 3 Readers: repeatedly read file.1 and check that<br />

all letters are the same.<br />

– If the readers see that not all the letters are the same<br />

they are seeing a half finished write; fail.<br />

39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!