ssize_t thread_read( nt fildes, void *buf, size_t nbyte )A call to thread_read() has exactly the same semantics as a call to the standard Unix kernel routine read(), except that, if there are other ready threads, thread_read() blocks only the calling thread. If there are no ready threads (other than the calling thread), a call to thread_read should block the calling process until data is available.
Problem: Propose an implementation for thread_read(). Hint: An implementation based on a busy-waiting loop that calls thread_relinquish() once per iteration is acceptable, and use of the O_NONBLOCK flag (settable by fcntl(,F_SETFL,)) is reasonable.
Part A: Where does the responsibility for security lie in such a system?
Part B: Suppose we demand that our system use garbage collection to reclaim disk space filled by files that are no-longer usable. Is this demand reasonable? Specifically, what information must be available to the garbage collector in order to assure that it never collects the space occupied by a file that some user can still access.