Software Systems Spring 2005 For today, you should have: 1) finished your project refinement. 2) read Berger Zorn McKinley 3) prepared for a quiz on memory management Outline: 1) quiz 2) schedule for the rest of the semester 3) Berger Zorn McKinley 4) thread introduction For next time you should: 1) work on your project 2) read Silberschatz and Galvin, pages 369-385, and answer the reading questions below. The extra pages are optional. Schedule -------- Six weeks left! Remaining topics: 1) file system implementation 2) threads and synchronization 3) I/O implementation, coordination device drivers asynchronous/synchronous I/O important thematic idea: the kernel is a big interrupt handler 4) real time systems multimedia control systems 5) distributed data systems replicated data / RAID distributed hash tables / peer to peer Upcoming events: April 5: exam #2 April 8: second refinement (April 12 is ok) April 22: draft of final report, including draft results April 29 to May 5: in-class presentations, OR May 5: in-class expo? May 5: last day of instruction, final report due May 13: final exam, 1-4 pm, AC 304 Reading questions ----------------- Silberschatz and Galvin, pages 369-391, and 1) In a SCSI system like the one we studied at the beginning of the semester, where is the I/O control layer of the file system implemented? In Figure 11.1, the interface between the application program and the logical file system is called the Application Program Interface (API). 2) Why do most file system APIs provide an open operation? Why not just access a file without opening it first? You can skip Section 11.1.2 Skim Section 11.2 before you read it. Contiguous Allocation and Linked Allocation are not used in current systems; they are here to help you understand the design space. Make sure you get to Indexed Allocation. 3) What is the killer drawback of contiguous allocation that makes it infeasible? 4) What is the killer drawback of linked allocation that makes it infeasible? The "combined scheme" and Figure 11.7 are important. We will discuss them in class. The book does not define "inode" carefully. Inode stands for "information node". It contains "metadata" about the file, like the owner, permissions, creation/modification dates, and pointers to the data blocks. A UNIX inode, as in Figure 11.7, is a specific kind of index block. 5) What are "direct access" and "sequential access"? Can you think of applications that are likely to use each? 6) In a file system, why can we use a bitmap to keep track of free blocks? Why don't we need a linked list as we did for memory allocation? Threads ------- What we have been calling a process consists of two parts: 1) a thread of execution, which consists of the program counter plus the state of the run time stack 2) an address space These things don't _have_ to go together. The most common way to tease them apart is to allow more than one thread to share an address space. pthreads are an implementation of this idea. pthread stands for POSIX thread; POSIX is the standard that defines the interface for creating and controlling threads. Let's look at some code: wget http://wb/ss/code/lock.tgz tar -xzf lock.tgz cd lock Let's think about some experiments we can do with example.c 1) Which segments of the address space are shared between threads? 2) Are the stacks for the two threads in the same address space?