The reading assignment: it seems that I'd already assigned 2.0-2.2 and 2.5-2.7. So, it looks like all we're missing is 2.3 and 2.4, so go ahead and read those. The midterms are available outside my office. Grades look like the following (out of 80) Mean: 53.4 Median: 57 Std Dev: 11.4 Range: 26 - 71 70+: 1 score 60-69: 12 scores 50-59: 17 scores 40-49: 3 scores 30-39: 7 scores 20-29: 1 score First, a disclaimer - I have no real business background, and you'd be better off following my computer science advice than my stock advice. However, there's something to be said about unusual places to make money. Here's what I mean about profitability about companies that build windowless buildings with satellite dishes on top: Public Storage: stock symbol PSA High of $39.29, within the past year. Current price: $30.29 Current yield: 6.05% Southwestern Bell: stock symbol SBC High of roughly $53, two years ago Current price: $25.01 Current yield: 4.12% For comparison, sinning and cheese-making yield the following: Philip Morris: stock symbol MO High of about $58, two years ago Current price: $37.03 Current yield: 5.96% And, for a real comparison, the Fed Rate is now 1.25%. The moral of the story seems to be that providing air-conditioned storage for boxes is a license to print money, and doesn't have the continual threat of lawsuits. And now for your regularly-scheduled lecture followup... More info on the radiation machine? http://courses.cs.vt.edu/~cs3604/lib/Therac_25/Therac_1.html Does locking mean that a process can only process certain data, or is that just the result of only 1 thread being able to access the data? Locking means that the program is using a facility to make sure that it restricts its own access to data in some orderly fashion. There's nothing (in general) that would prevent a programmer from forgetting a lock and then having an incorrect program. Does software have to be written to take advantage of multiple processors when adding a processor to a system? Anything about Intel's hyper-threading? It depends - if you want one application to run faster and it's the only application on the system, then you generally have to develop it using multiple threads or multiple processes. If you have two processors and more than 2 jobs ready to run on your system, you'll get benefit that way as well. The Intel hyper-threading is an implementation of Simultaneous Multithread (SMT) - details at http://www.cs.washington.edu/research/smt/ Can you explain kernel-level threads again? Basically, think of a kernel-level thread as being just like a process, but sharing much of the information in the process control block with other threads. So, kernel-level threads can be scheduled independently on different processors, have one system call in progress per thread, block independently, etc. How does thread scheduling take place? Is it like process scheduling? Yes, basically. The scheduler needs to perform accounting properly - all time consumed by the threads should count toward the process that spawned them, and one presumably wants them to share some scheduling priority information such that running extra threads doesn't give a process unfair access to the CPU. Who decides what thread runs if none of them are holding a lock? When a kernel supports kernel-level threads, the scheduler has to be aware of them and make decisions about which of them run. Some thread libraries have ways of assigning different priorities to different threads within a process. What's the difference between a wait and a sleep? I need more context to answer this one well In what sense are threads "backed" by kernel threads? Let's say we have 100 application threads backed by 10 kernel-level threads. It means that the application can generate a total of 10 simultaneous system calls, run on 10 processors, etc. So, when one of the application threads wants to run, it's mapped to a kernel thread, and it executes as that thread for the time it runs. How do you specify if you want a thread to be user-level or kernel-level? Generally, it's a matter of what kind of thread support the OS has and what kind of library you're linking into your application. For a general idea of what a thread library provides, do a "man pthreads" on a Solaris machine. Specifically, if you look at pthread_attr_setscope, you'll see that it's possible to specify whether a newly-created thread is tied to a kernel thread or not. Can you go over the matrix example again? Well, the matrix wasn't particularly well-chosen as stated, since the two original matrices are read-only and each cell in the output is independent of the others. However, the general idea is that if you want to do a matrix multiply in parallel, you could have one thread per element of the result matrix. This would work, and theoretically you could have lots of parallelism, but the reality is that creating a thread takes time, and unless N multiples and N adds take a long time, you may not gain much in the process. So, you could have the different threads work on different areas of the output matrix, and then this would make more sense - you could use a number of threads equal to the number of processors, and as long as your matrix is in memory, you'd run at close to the maximum performance you could expect[*] [*] there are various cache-friendly ways of doing matrix multiples that would be faster, but I'm ignoring those. How much overhead would one thread per matrix element be? Kernel thread creation invokes a system call, has to allocate a stack and a thread control block or process control block, and has to set up various pointers. I'd be surprised if 100 multiplication/addition steps weren't faster than that. Can we get virtual memory assignment early? I'll ping the TA I was out during slide #9 - what was it comparing? The left side is kernel threads, and the right side is user-space threads. I was wrong on slide 12. Switch on leave note A. switch on if(noNoteA). Thread A removes note A, then thread B removes note B. I thought that's what we'd concluded - A leaves its note, B leaves its note, then A notices B's note and skips the part inside the "if" B notices A's note and skips the part inside the "if" both remove their notes no milk gets purchased Can you explain locks again? Let's come back to this if the reading doesn't take care of it