Windows NT Systems Programming
[ Home
| Syllabus |Course Notes]
Review for Mid Term
Assignment 2
Issues:
- What constitutes a corrupted "messages" file?
- How can you detect this?
- What has to be rebuilt?
What are the Systems invariants?
- First "int" in file has the value
"MAGIC_COOKIE"
(how big is an int?) BAD DESIGN CHOICE?
- There
is a 1-to-1 mapping from message items in the list following the nextMsgItem to each
message file in the folder
Each message file has an entry with that file name and the topics match.
- No two messages can have the same filename (Uniqueness)
- Each message file consists of a fixed length
topic and text section.
Detecting Corruption of the Messages file
- Test the value after opening the file
- Not fully tested. When opening a message file using filename in
the messages file can detect missing message files or corrupted file names. Topics never
checked for consistency.
- file system will prevent duplicate file names (because of CREATE_NEW)
- Not of concern for the messages file
- Message file must exist
- Message list must be multiple of size of Item
Rebuilding
- MAGIC_COOKIE: easy
- nextMsgNum: hard
- MessageList: let object do the work.
- Need to enumerate message files, get topics, filenames
Assignment 3
What are reasonable requirements?
- should NEVER corrupt "messages" file
- should NEVER allow two or more simultaneous updates (Multiple
Writers)
- What about a reader seeing a newly written message?
- What about a reader, reading a message just deleted?
- What about a reader reading a message just updated?
- Who is a writer? who is a reader?
- What race conditions exists for writers and incoming readers?
Copyright chris wild 1997.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: October 06, 1997.