 Okay, okay. Hi everyone. So today, our seventh recitation, we're going to do midterm review. We're going to go over time and date of the midterm, and then we're going to go over the material of the midterm, midterm exam format, and tips on how you should prepare and solve the questions on the midterm. So midterm exam overview. The midterm will be on Friday, if you know. It's going to be the lecture time, 2 to 2.50, 50 minutes. Please arrive early, either just by 1.30. The location is going to be the same as the lecture classroom, but please keep an eye on the discourse forum. We will be posting just like important announcements regarding the seating, and if there is any location change. But for now, these are the location and time of the midterm on Friday. And for this course forum, I noticed that several students just check the assignments category. Please check all the categories, including the class announcements. So, for example, some students, because they were checking only assignment to category, they didn't know that we were just like posting the slides and the video of the restation. So, whatever midterm exam announcement going to come under the CSE 421, 521 category. So, make sure you always check all the categories on the discourse forum. The midterm exam material, so whatever is covered in lectures, recitations, going to be included in the midterm. However, the midterm question going to be comes mainly from the lecture notes and slides, which has some overlap over what you've done during your programming assignments. So, the midterm topics, to summarize them, you covered the process abstraction, synchronization, interrupt, and exception handling. And then you covered the scheduling algorithms, and then you started into the memory management, which you should be continuing on. We should, Jeff should cover the swapping on Wednesday. So, whatever covered up until the end of the lecture on Wednesday will be covered in the midterm exam. So, just like to give you an idea of things that were discussed during the lecture. So, process abstraction, we've mentioned that process is a way for you to organize information about other abstractions. And since we have a single threaded processes, then a process represents a single task that a computer is doing. And a process is not tied to hardware. Just like other abstractions, it basically contains threats that are abstracting the CPU. You have address space that abstracting the memory. You have files that abstracting the disk. For file systems, we've covered that there are levels of abstraction, that you have a file table that has references to file handles. You have file handles that have references to file objects, which in turn has references to blocks on disk. And we've also mentioned that there are sharing policy, different sharing policies for each one of these levels. File tables are private to every process. File handles are private to every process until we fork. Then it's going to be shared between the parent and the child process. And then we have the file object, which is shared system-wide. You also covered in the class and during your programming assignment file and process syscalls. You should know these syscalls. You should know what each of these syscalls does. And you should have a good idea of what each and every system call does and maybe the order of execution that happens with each of these system calls. That's for the process abstraction. Then you covered the synchronization so you should know what is a critical section and why do we need to protect the critical section. You also covered in the lectures and during the programming assignments the synchronization primitives, spin locks, slave locks, semaphores, condition variables, reader writer locks. Make sure you do understand each and every one of them. How they work just like the interface of each of these synchronization primitives. Make sure just like you understand them to a level that you can differentiate between them. It's like if we ask you, if we give you a problem, you do know which is the best to be used for such a problem. You have several concepts that are associated with the synchronization, which is you have race condition, you have deadlock, starvation, live locks. You should know the definitions of these. What are the differences between each of these one of these situations and how we could avoid these situations. Also make sure that you have an idea of the synchronization problems given to you either during the class or in the restation like the dining philosophers, producer, consumer example. If they are given to you in the exam then you do have an idea and just like do not struggle trying to understand what is the actual problem. And then after covering the synchronization, you covered the interrupt and the exception handling. So for interrupt and exception handling you need to know different types of interrupts and exceptions. Also keep in mind that interrupt and exception are not the same thing. They are different. You have timer interrupt, you have software, hardware interrupt, and these are the interrupts basically to, it's a way for the user program to request services. And the exceptions basically happen when there is an error happening just like dividing by zero, page fold, memory fold. And this is when an exception happens. So make sure you know the different types of interrupts and what happened when an interrupt is a trigger. We said that you need to trap into the kernel mood and then you need to save the state and then you need to jump to a predetermined memory location which is 0x80 million. So make sure you do know all these concepts for the interrupt and exception handling. Then you have the context switching just like when you take one thread out of the core and replace it by another thread and you need to know what happens when a context switch happens. So you are in a user space and then you need to switch into the kernel, make the context switch and then you need to go back to the user space again. So you need to understand all these steps that are happening during a context switching. And then the context switch would bring the scheduling topic on the top just like how should we decide when a threat should be evacuated from the core and replaced by another. So you should know the threat states running, waiting, ready. And you should know the different state transition from one state to another. What does it mean? For example, if you're waiting and then now you're ready, you was a waiting thread and now you are a ready thread, that means the condition that the thread was waiting for happened. If it was running and then terminated, that means the thread exited. If it was running and that if the thread was running and now it's in a ready state, that means it was diskegeled. If it was in ready state and then it was now it is running, that means it is scheduled to be run. So you need to understand these different threading states and what does each transition mean? And this is also all part of the context switching thing. And then we've been presented by several scheduling algorithms like MLFQ, Round Robin, Short Job First, Know It's All, Know Nothing. So you need to know how these algorithms are just like, you need to have the idea of what does each algorithm does and what are the advantages and disadvantages of each of these algorithms. So you can just like compare two of them or try to solve one of the disadvantages of a given algorithm. And then we moved into the memory management. So for memory management you need to really know what is a virtual address, what is a physical address, what are the differences between both and how can we translate a virtual address to physical address. And I think there's been two or three classes covering this up until you reach the idea of a page table. Now what is a page table and how should we implement a page table? So you need to know that every page table entry, what kind of information should it have and for every kind of implementation that we could have for a page table like flat array or list or two level page tables. You need to understand this implementation so you could just like, if you were asked for the advantages and disadvantages you can answer them. You need also to understand what is, why do we need a TLB or first what is a TLB and why do we need it. You know that TLB is a transatlucasite buffer and it's basically hardware cache. So you should be able to differentiate between a page table, TLB, you know that this is a cache that's a data structure and that a page table keeps a track of the virtual pages while the core map that you should be implementing in 3.1 keeps a track of the physical pages. Then you have the memory fault types. You should know the differences between these just like you have a TLB fault, you have a page fault. You should know that when each one happens so a TLB fault when an address translation is not present in the TLB, this is where a TLB fault happens. A page fault means that a virtual page content is not present in the memory or that virtual page is not physically allocated. You should also know that every page fault is preceded by a TLB fault while the other way around is not true which is every TLB fault not necessarily should be preceded by a page fault. So you should understand all these types of faults and you should be able to differentiate between them. Then we have the swapping. You should know why do we need swapping, what problem we are trying to solve with the swapping and what are the different kinds of algorithms that you can implement the swapping just like how you should decide which page you should swap out and that should be covered in the next lecture I believe. So that's basically for the content of the, this is just like an overview. You have the details in the lecture notes. So make sure you understand these concepts. The question going to be just like will basically test your knowledge for these concepts. So before we move into the format, any questions? Okay. So for midterm exam format, this is based only on previous midterm exams that are available on the website but that doesn't mean necessarily it's going to be the same on Friday. But for previous midterm exams, this was the format of the midterm. So the midterm total points is 50 points and you have 10 multiple choice questions each worth one point and these are basically from, comes from the lecture slides and should be pretty easy to answer. You will have six short answer questions and we will give you credit for the best four. So you should, you're only required to answer four but you are also welcome to answer all of them if you want if you had the time and we will give you the best credit for, we'll give you credit for the best four of these answers. Each short answer question worth five points so we have four so total of 20 points and you should be able to answer these questions in four, five sentences. You have just like every short answer question is on a separate page. That doesn't mean you need to fill out the whole page. So only four or five sentences should be enough. Please take it and keep in mind that you only have 50 minutes to answer these questions and then we have two long answer questions and you're only required to answer one and please answer one. Don't answer two just like the same as the short answer. We will only be grading one of them. We will not grade both of them so decide on only answering one of them and this is the one that you are going to answer and leave the rest, leave the other one. So one question, one long answer question worth of 20 points and the answer to such question should just like the one or two page longs and that's for the format. Any questions on the written format? Okay. Now how should you prepare for the midterm exam? Study the lecture notes. This is the main source of questions, the lecture slides and notes. As you're studying make sure to link whatever you're learning to your programming assignment experience and the material that we cover during the recitation. You're going to be able to read all of the material that we cover during the recitation and once you're done reviewing the lecture slides then start solving previous exams. This would give you a good idea on what to expect on the midterm. Now how should you answer? Please make sure you answer clearly and provide diagrams, figures, whatever that can help but please be organized and if you have several sub-questions make sure you identify each one of them so as we grade we know that this answer is for part A or part B. Be concise and be organized. So use bullets just like mark each answer as to which sub-question it relates and answer the question just like some students like even if they don't know the answer start writing some just like try to answer it in some other way but ending up with something that doesn't really relate to the question and we cannot really give even a partial grade for that. So make sure you understand the question and then start answering. How you should allocate your time? So thankfully your midterm is out of 50 points that means if you give every point one minute then you should know how you should allocate your time. So you have 10 multiple choice questions. These should take 10 minutes. You have four short answer questions each worth five points that means no more than five minutes for these short answers and then you have the 20 point long answer question and please make sure you keep at least 15-20 minutes for the long answer question otherwise you won't have the time to just like answer even half of that question. So the point value assigned to each question should give you an idea on how much time you should allocate for every question and for the long answer question please you will have a long question depending on the question but maybe you would have more than one paragraph to read. Make sure you do read everything. You do read the whole question. Don't just read half of the question and start answering. We get a lot of students that basically didn't read the second half of the question where are the actual question located and they just answer based on the first part that they read and they end up getting zero. So please read the whole question and even if you just like find some terms that you really don't understand just don't freak out. I mean continue as you reach the question you should get an idea what should you be answering for that question. So read the question see how much points are allocated. Sometime we just like mention for each part for each sub question how much points we are allocating for that sub question. So make sure you spend time based on that and also answering the actual questions that you are given. And how you should go about answering the long answer question. So we will test your knowledge on the topics that we covered in the lectures. So try to just like link the question to the knowledge that you had. It might not be very just like exact questions on something mentioned in the lectures but it would be something that is being covered. For example synchronization primitives provide some one of the questions I remember just like was provide a new synchronization primitive other than the ones that you've studied for example. Or given a synchronization primitive that you've already implemented how you could solve that problem or maybe some algorithms that has some disadvantages how you could overcome these disadvantages. So basically we will be testing your knowledge on the topics that were covered during the lecture and your experience of programming assignments. The conceptual part not the coding. But still you might be asked for example if you were to implement a synchronization primitive we might ask you for example give us the interfaces for such a primitive just like create, destroy, acquire, release for locks. So something similar to that. You might be asked for interfaces. So yeah that's all we have for today and now if you have any questions on the midterm you're welcome. Please if you had also time if you're done with studying for the midterm start with 3.1. Don't just leave it for next week. Whenever you have a free time just make sure you work on the 3.1. So any questions that's all I have for today. Okay so thanks for coming good luck with the midterm exam. If you had any question we are still holding office hours whether for the midterm you have questions or for the assignment please come stop by. Thanks.