All I ask is that you do not take what I say personally. I get more comments from older videos regarding salvation. And if someone's going to say in a comment that I'm going to show you that salvation or in particular one saved always saved is my favorite topic. Well, my favorite topic is salvation. Why? Because that's literally the point and purpose of the Bible. That's the greatest thing that we can hang our hat on. It's one thing that we are grateful for. We're not grateful for money in the account. We're not grateful for good health. If all we're going to do with that is then take it to hell. No, we are grateful that we have salvation in Christ. And in that the Bible is clear that our salvation is eternal. And we have it right now lasting. And so that being stated, this person left a comment on another video that I called that I entitled unbiblical. And everything in the video was dealing about things that people believe, state or say that is unbiblical, meaning it is not in the Bible. And one of the things that we talk about or that people talk about a lot is loss of salvation. And the definition of something being unbiblical is that it's not in the Bible. So if there's no example of it in the Bible, then guess what? By definition, it is unbiblical. And so what example do we cite a lot that's not in the Bible? There's no examples of it. There's no there's no stories of it. That is someone losing their salvation. And so this person says that Corey has Dr. Brown on the list, a man that thoroughly cleaned his cloths, facts in my opinion, on what seems to be Corey's favorite subject, one saved always saved. Yes, why is in salvation your favorite subject? It ought to be. But his belief is that Dr. Brown cleaned my clock. We had a formal debate. Now, in terms of holding onto the rules, he did. He knows the rules of formal debates far better than I do. And I'll never want to do a formal debate again, not because of what happened, because I don't think that he made a point. Not one, but you don't get a chance to actually bring out or flesh out your points that you're trying to make. I would much rather have a conversation. And even in the conversation we had about tongues, we were only limited to an hour. I want to have a conversation where there's at least two hours and we can kind of go through things at our own pace and not rush through things. But that's another story for another time. He says Corey was essentially left dealing with one passage in John while Dr. Brown provided a myriad of scriptures. He covered a lot of scriptures. I did too. Now, I did not introduce my scriptures early on, because, again, I wasn't familiar with the rules. My mistake. Nobody's fault but mine. However, this one passage, which I did more than one passage, but this one passage is one of the one passages that I bring up. And there's a reason for that one passage. But as he says, since only one passage needed to hold to a doctrine, Corey, how about First Corinthians 14? Now, this is about forbidden speaking tongues. Well, have I ever forbade anyone from speaking in tongues? And so I don't know the point that he's trying to make. But my response was similarly along those lines that I ever do such a thing in terms of forbidden tongues or have I ever said I was a satanist. But I says, as for the debate, Brown had a better grasp on the formal debate rules yet still couldn't answer that one verse. And we're going to look at that in a second. He says, he referred me to two other men who also don't answer that same verse, which is true. We're going to look at that also. His response after that was, in a test of intelligence, you may have seen the common four or five items shown with the question, which of these figures or items do not belong. I don't know if any intelligent question, any test of intelligence that says one of these things is not like the other. As a matter of fact, that reminds me of a nursery rhyme. Not something to do with intelligence, but I digress on that.  And so he uses the wrong word for your, it should be Y-O-U, apostrophe, R-E. You are simply rather foolish in my opinion, which is fine. You are free to state that I'm foolish in your opinion. We'll see how foolish and just a little bit. Lastly, if the crux of your soteriology is hanging on one verse, rethink it. It is not hanging on one verse. But continuing, I and others were not caught up in the whole debate etiquette, rather the substance. Have a good day, brother. So let's deal with this. Again, every person on the list, and if you go back and watch the video, the video was things that people believe that are unbiblical. They're all brothers and sisters in the Lord, or all brothers and sisters in the Lord can believe something that's not biblical and still be Christian, okay? But believing something that's not in the Bible is by definition unbiblical. Can this person or anyone on the planet ever cite a case in the Bible where someone had salvation, someone had the Holy Spirit in them, and then lost that salvation? No, so by definition it is unbiblical. Now, that being the case, I want to go and look at a couple of other things. I want to look at one, I had a conversation with a person who has challenged me on the topic of one saved, always saved. And in the conversation, I have cited a rule. So before I even go to that, let's go to the one verse that people think that that's my only verse, but let's go to that verse anyway. That is John 10, 28.  The purpose for me citing that is because one, if there's ever an example where Jesus or someone in the Bible said that it is literally impossible for you to lose your salvation, then we should cite it. Is it possible that someone could say in the Greek, it's impossible to lose your salvation? Is that possible? Well, sure. Just like you can say in English, it's impossible to lose your salvation. You can also say it in the Greek, meaning we've got such an example. As a matter of fact, we've got quite a few examples of that. We have what's called an emphatic negation of either a subjunctive or a future active indicative. A subjunctive just really briefly is words that convey potential might make. And so if you have a double negation, it negates the potential of it happening. And so if I say that it is literally impossible, there is literally no potential of you ever perishing. If I say that in the Greek, then that's exactly what Jesus says and that's exactly what it means. Or if I say with a double negation in front of a future active indicative, meaning something will happen in the future, but if I give a double negation, then I'm saying that it is literally impossible. It will never, ever, ever, ever happen, not even in the future. Both of these double negations, emphatic negations, negate the possibility of something happening both now or in the future, whether it be a subjunction or a future active indicative being negated, both of those do the same thing. And we're going to look at both of those. The reason why I bring up John 10-28 is because at present, I have not found one Greek scholar. When I say Greek scholar, not a person that graduated that took Greek. No, someone who is a Greek grammarian, someone that studies the Greek text, someone maybe on a translation committee, somebody. Are there people who are scholars who disagree with one saved always saved? Sure, but can they answer this question? I have not found one. And if there is one, I just want someone to point me to one and I want to see their response. Dr. Brown brings up two people's names and we'll see if they actually covered. They do not. But I had a conversation with a person who's got another channel. He goes by the name of Mauler. He was on and we had the conversation and I was talking to him about the rule. The challenge was get anyone refute my exegesis, my exegesis of the Greek text. Here it is in the Greek. It says, notice what it says. And I give to them life eternal. That's clause A. Clause B. Caio me apolontai and they will never perish. That's clause B. Clause C and says, and no one will snatch them out of my hand. We're going to come back to that clause C as well. But we are not going to have a passage where clause A contradicts clause B. Clause B contradicts clause C. That would be kind of strange if any one of those clauses contradicts the other. So even in English, if we look at it, I give them eternal life. Well, if a person could ever perish, if a person could ever walk away, well then that would negate, that would contradict clause A that I give eternal life. Certainly clause B that they will never perish if a person could walk away. This is literally what Jesus is saying, they can never walk away. There's more to it to that. And there's a reason why he brings in clause C and no one could ever snatch them out of my hand, which is why it says, the Father who has given them to me is greater to all. But notice what he says in the Greek and my interpretation, my exegesis of the Greek. But because I'm not a Greek scholar, does that negate the fact that I can read the Greek, understand the rules, apply the rules properly? Does not at all. As a matter of fact, I know for a fact that I am doing this properly as you look at any Greek text, as you look at any Greek grammar, be it intermediate or advanced, a beginning Greek Bible study, you can't find anyone that negates. As a matter of fact, they always seem as far as I can find affirm what I'm saying. I didn't invent the rule. And the rule is not only applied to this, it's applied to other areas. When Jesus says that not one jot or tilt shall pass away before heaven and earth pass away, that particular passage Jesus makes, he uses this in fact negation, meaning that it is literally impossible for heaven and earth to pass away before his words be fulfilled. So it's not just used here. And if you take that same rule and apply it, we know it's impossible for it to happen. Similarly here, we have what's called a double negation of a subjunctive. When you have the oo, which is no, not, never, may, same thing, those two words before this subjunctive, which is to perish or may perish. In this, in this case, apalontai means may perish. It says no, not ever, ever, ever, surely not ever, never, ever, perish. And I was extra emphatic with that because that's literally what it says. Jesus is making the statement that perishing in the future is literally an impossibility. He says that there is no possibility of them perishing in the future. And he, and we reference Daniel Wallace, one of the preeminent Greek scholars on the planet, one of the preeminent Greek textual critics, textualists, we reference him because in his book, Greek Grammar Beyond the Basics, he references this rule. Other folks reference this rule as well, other Greek scholars as well. And what is being negatized is the possibility of perishing in the future. In other words, nothing in the future, according to how this rule is used, shows that a person can perish. So when I had this conversation with this person in Mahler, listen to what he says. It's an improper use of that rule. That's it. And all I'm saying is, all I'm saying is this, if you're going to say that it's an improper use of the rule and you don't know the rule, how do you make that statement? Now, I'll replay that again, but he had no idea what the rule is. I read the rule, he misunderstood the rule, I showed him the rule even more so and went further into the rule. And so he's getting an understanding of the rule that no Greek, it's not a knock against him, but he had no Greek, certainly doesn't know the rule. And so I'm explaining to the rule for the first time, him hearing the rule, he tells me that I am misapplying the rule. Yeah, the rule that he's never heard of before, the rule that he didn't know of before, as well as to say that Daniel Wallace, Dr. Daniel Wallace also is misapplying the rule. So let me go, I want to go ahead and put it back on the screen and let me rewind this. You know the rule, you educated me on it and I think it's an improper use of that rule. That's it. And all I'm saying is, all I'm saying is this, if you're going to say that it's an improper use of the rule and you don't know the rule how do you make that statement? And I do know the rule. You educated me on it and I could see that you're improperly using it because that's what I thought before. And now today I have to confirm, I don't agree with your use of the rule. Nor Daniel Wallace has said that that's his commentary, that he comes to the conclusion? Absolutely not. And now that I know that he is what? Osas, I'm really going to be skeptical. I'll take it, but I'm also going to find others. And when I find others, they're going to say, no, I can't say that it says that. Now a couple of things. First of all, it's the height of arrogance. It's actually, let's just be honest, it's foolish to state that the doctor, the scholar, the actual scholar, not me because also it'd be foolish to even say that this guy who knows Greek, who just told you about the rule, who educated you about the rule, which he also said, you just educated me about the rule, to come back and say that you don't know the rule. You misapplied, you misused the rule. And then to say that Daniel Wallace has also misapplied the rule. Can we find a scholar, one scholar, one Greek grammarian who will say, no, Daniel Wallace has misapplied this rule. Can we find one that says in any of the other Greek grammars, intermediate or advanced or even basic beginners that will say that that is an improper use of this text, of this grammatical rule. You see people like the Bill of Mounds or Robert of Mounds. You've seen the Buies fans. You've seen the other people who have stated the same thing. This is a proper use of the rule. This is what the rule is referring to. This is how you use it. And so to come back and say that no, I didn't know the rule. You educated me on the rule. And now that you did, I see that you've misused it. No, that's just apt. That is silliness at a highest level. That's what it really is. It's arrogance. It's an unwillingness to see that you might be wrong. And someone can say that, Cory, you're unwilling to see that you're wrong. But remember, I used to believe the exact same thing as stubborn as I was and maybe still am. I was not willing to bend. But in the face of the scriptures and in the face of the rule, what am I going to do? Say that they're wrong. Why? I have no basis to state that I am or that they are wrong or and I am right. Again, so that is the problem. But then, going back to the comment that the other person had about Dr. Wallace, I'm sorry, not Dr. Wallace, but Dr. Brown, he stated that that that one verse, that one passage. And so when I had the debate with Dr. Brown, I want you guys to hear how he responded to what I said. Do you interpret John 1028, the Greek of John 1028 to mean that a person can not or I mean that the person can in fact perish? If so, why would you do so? Now, the question was, do you interpret John 1028 to mean or to show that a person could perish? Let's put the pastor on the screen. And they will never perish, clause B. So the question is, do you interpret that to mean that they could perish? When it literally says, even in English, they will never perish. But you interpret that, there's a way to interpret that to mean that you could perish. Okay. Let's listen to his response. Because John 1027 identifies the sheep as those who are on going way, listen to his voice and follow him. So you can be a sheep and then you can cease to be a sheep. Those who are his sheep and this is a constant theme and the same in John 637 to 40. Now a couple of things. It doesn't say that. It doesn't say that if anything, there's no conditioned place on that. However, even if we take that, I don't have a problem with you putting a condition in there. By the way, go find that condition. Go find a word or a phrase, a clause that is conditional.  Show the passage.  In verse 27 says, my sheep hear my voice and I know them and they follow me. What is it saying? This is telling them what sheep do. Sheep hear his voice. This is in the indicative, so it's saying what sheep are doing. It's not a condition. It doesn't say that that sheep, if the sheep keep hearing my voice, that's not what it says, dear Dr. Brown, and he should know better. It does not say if they keep hearing my voice and if I keep knowing them and if they keep following me, that is not what it says in anywhere in John 10 or as it relates to this issue. We don't find that. So you cannot say that that's what John 10-27 is saying. It says that he's really stating what his sheep do. We'll come back to more of John 10 in just a second, but again, what does verse 10-28 say? The tendency of them because they cannot get past 10-28 is to say, well, the reason why John 10-28 doesn't say what it looks like it says is because you've got to really understand what's being stated in 27, what we do, as well as all of John 10. 44. Speaking of those who continue in the faith, those who persevere in the faith. But then the Greek of this are such as Dr. Stevens, Dr. Mounds, Dr. Fanning, or Dr. Wallace, and they will tell you that implicit in this double negation, this emphatic negation of subjunctive means that the sheep cannot stop following. The sheep cannot walk away. The sheep cannot stop being sheep because of this ume apollon type. How does a person get around this grammatical construction of the Greek and say that now, all of a sudden, the Greek rules don't matter? Well, that's the interpretation of some scholars. Surely you know other scholars. I would hope you've researched enough. Now, he says, surely other scholars would disagree. Let me have one. Let me have one that not just people that understand Greek that disagree. I want an actual Greek grammar. But they don't deal with the text. And that's the problem that I have, including those that he points me to. That you know other scholars who don't read it like that. I haven't found one. You don't understand the text to say that. But I have found one. Let's check out Professor Robert Gagnon. Start there. Okay. Take out Professor Robert Gagnon. And what he has to say about, one saved always says, he's a highly, highly respected Greek and New Testament scholar. I've heard other scholars say so, but I've never heard, and I'm still waiting, for one Greek scholar or one Greek grammarian to refute what I'm saying in John Tenton. That's not me saying it. Cory, Cory, I'm answering you. There are other Greek scholars who differ. But they're not a Greek scholar. I'm a Greek scholar. But you're not a Greek scholar either. So you're relying on these others. Okay, so a couple of things. One, you didn't answer the question. All he did was deflect and say, go look at someone else. But they have to say, and you're not a Greek scholar either. Okay, fine. We don't have a Greek scholar. So that means we have to wait to interpret this passage when we get a Greek scholar. And oh, by the way, let's go to one of the ones he spoke of, Robert Gagnon, who he put as a Greek scholar. He's not a Greek scholar. He knows Greek. His area of expertise is, I don't think it's the Greek, as a matter of fact, in looking at his bona fides, and it didn't seem like it is. But here's his response to John 10, 28. Oomee plus the subjunctive and emphatic negation. He says, surely indeed not. But that says nothing about one saved, always saved. The key question is, who are the sheep? Verse 27 is clear. Verse 28, does not apply to those who stop following Jesus. So notice what he's saying. He's saying, the key question is, who are the sheep? Well, that's never really been the issue. We know who the sheep are. Jesus is describing the sheep. And so what does he do? What everyone else who cannot deal with 10, 28, they say, well, you've got to understand everything else first, which we do, but he's making as though that 10, 27 is a conditional, that if you keep following, if you keep hearing, says the key questions, who are the sheep? 27 is clear. Verse 28, does not apply to those who stop following Jesus. Because we never state that sheep will ever stop following Jesus. As a matter of fact, John 10 earlier tells us that sheep do not stop following Him. They'll keep following Him. And he says, all New Testament authors and Jesus presume that it is possible for genuine believers to fall away or at least want their audience to believe or think that. Where do we find that in the Scriptures? Give one example of someone ever falling away. Give one example of someone who was a believer who stopped being a believer. You cannot. That's the problem. Because you have pigeonholed yourself into an argument that you can lose your salvation, which by the way, to me, this is just me, is the height of arrogance. This is you having something to boast about, that you are the one that's keeping yourself safe. Because you understand the rules that God has laid out because you love Him so much, because you just don't want to sin, that you have kept yourself from falling away. You can't keep yourself. That's the great lesson that we've learned from thousands of years of biblical history from Genesis up to the cross. You can't keep yourself from sinning. That's why Jesus says, that's one of the words, I'm sorry, Paul says in Romans that there are none good, not anyone. No one is righteous. No one is seeking after Him. That's the whole point. And so let's go to John 10, because again, this one scripture that the person brings up says that it's the only one. First of all, it's not the one scripture, but can we find somebody, and I might bother somebody on this, but if you're going to say that it's the one scripture, we'll find some one person who is going to refute this one scripture. Whether it's Gagnon, whether it's Robert Shakerny brings up, none of them deal with 1028. They're saying that a person has to keep being a sheep. Where is that in John 10? So let's go to John 10, and let's start in verse 4. And you find someone, I will, listen, my wife hates when I say this, but I want to say this, and I want to be as clear, as concise, I want to be as bold and confident as what I'm going to say, because I want the people that disagree, who vehemently disagree, to go to this passage and show me where the if is, whether if you stop being a sheep is, if you stop following, or you must keep following, you must know implicit in John 10 is that sheep will. This is what sheep do. It's like, if a fire remains hot, well, no, that's what fire is. Fire is hot. Not that the fire has to remain hot. Sheep keep following. Sheep here, that is Jesus's sheep. So let's go to the passage, John 10, 4. Jesus says that when he puts forth all his own, he goes ahead of them. And the sheep follow him. The sheep are found. This word, the Greek word is aquiloufe, which is that they are following the present act of indicative. It may not refer to that. That's what they're going to keep doing. However, we're going to see that's actually what he's saying. Sheep are following him because they know his voice. So why are the sheep following him? Because they know his voice. And now verse five, you might want to add this to one of those one passages. It's not just one passage, but this is also one of my favorite passages. Why look what he says and notice the rule coming up here. A stranger in the English says they simply will not follow. Now, that's a nice way of putting it. A stranger, they simply will not follow. This is Jesus trying to get you to understand. What do you take away when Jesus says a stranger, they, the sheep, his sheep simply will not follow? How do you take that to say that a stranger, they will follow? Jesus says, said they simply will not follow. Can I tell you how emphatic this is? This is one of those double negation of a future active indicative. He says a stranger, and then we have here, who may accluthasus in. This accluthasus, this is a future active indicative, meaning he is negating the possible act of it happening in the future. It cannot occur anywhere in the future. The future possibility of them following a stranger is implicitly and emphatically negated. By who? By Jesus. Maybe Jesus did know the rule. Maybe the writer, John, did know the rule. Maybe that's what it is. But a stranger, they simply will not follow, but coming up a stranger, they simply will not. They will never, ever, ever follow. Who are they? The sheep. So he's describing what sheep do, and he says a sheep, they will not ever, ever, ever follow this strange voice, but they will flee. They will flee. This is a future, a plural future middle indicative. They will flee. This is what they will do. This is what sheep will do. Jesus didn't say if they flee. No, he says they will flee. Who will flee? The sheep. Why will the sheep flee? Because hotting Uqoydasim was because not. They know. They don't know the voice. They will not.  A sheep does not know the voice of Hinduism, Buddhism. A sheep does not know the voice of atheism. A sheep does not know some strange voice bidding them to leave the fold. The sheep doesn't know that. Will a sheep be wavered at some point in time? Yeah, but they're his sheep. So what will they ultimately end up doing? They'll keep following him. They may not follow in a straight line. They might follow kind of in a zag line or whatever, but they will keep following him. Why do I say so? Because that's literally what Jesus said. Not my words, but his word. He says this. They do not know the voice of the stranger. Whatever this strange voice is going to be, they will not know. And if anyone wants to say no, he's talking about Jewish sheep. Well, let's go to verse 14. He says, I am the good shepherd. And I know my own. I know my own. There's nothing conditional about that. There's no if there. If I know my own, then my own will know me. No, I know my own. If they know me. No, he says my own. I mean my own, know me. He says first, I know my own and my own know me. Even as the father has, even as the father knows me and I know the father and I laid down my life for the sheep, which sheep, his sheep. He says also, I have other sheep. Who are the other sheep? Well, obviously this is a Gentile. So he's speaking about, he's talking to the Jews at this moment. He says I have other sheep which are not of this fold. He says I must bring them also. And look what he says. They will hear my voice. So what will sheep, the Gentile sheep also do? They will hear his voice. This Greek word right here, Akkosusan, this is a, this is future. And so they will do this in the future. Future actor or digger. They will hear his voice and they will become one flock with one shepherd. Now, what's the problem with the Jews? Well, the Jews have a huge issue that Jesus brings up. He says, but you do not believe. You do not believe. Why? Because you are not. Hattueste, because not are of the probatile. You are not my sheep.  They hear his voice. They follow him. They won't follow any other voice. They simply will not follow but they will run or flee from another strange voice. That's what Jesus says.  He said, it's literally impossible for them to perish. Is there a way to say that something is a possibility from happening in the future? There's two ways, an emphatic, a double negation, an emphatic negation, double negation of a subjunctive and of a future actor and digger. We have both of those cases here in John 10 in verses five and in verse 28. Now, there's only three possibilities that are there for persons salvation. That is if God turns his back on them they or we turn our back on him or someone snatches us. Well, the third one is taken away because he says and no one will snatch them out of my hand. My father who has given them who's the them, the sheep. His father, God has given us to who? To Jesus. That's important. We'll deal with that in a second. And he is greater than all and no one is able to snatch them out of the father's hand. So the third option, someone snatching us out of his hand, that can't happen. But what about the first two options that we could possibly either turn our back on him or he can turn out his back on us. Well, one of my other one favorite verses is Jeremiah 32 39. Look what he says and I will give them one heart and one way and they may that they may fear me always for their own good and for the good of their own children. Look what he says. I will make an everlasting covenant with them that I will not turn away from them to do them good and I will put the fear of me in their hearts so that they will not turn away from me. So two things that God has stated. One, he will not once his spirit is in us and we'll deal with the fact that someone might bring up he's talking about Israel. We'll deal with that. We'll see that it's not just Israel he's talking to because he's also going to apply this to Gentiles. We'll deal with that in just a second. But all those whom he puts his spirit in he says he's not going to turn his back on them and they will not turn their back on him. So one possibility is him turning his back turning away. He says that's not going to happen. The second possibility is us with his spirit in us turning away from him. He says that's not going to happen. And then the other the long possibility is that neither turn their back on the other but someone comes and snatches them away. Jesus already foreclosed that possibility. Now dealing with this issue of having his spirit in us in Ezekiel 36 20. Let's start in verse 25. He says then I will sprinkle clean water on you and you will be clean. I will cleanse you from all your filthiness and from all your idols. This is what God has said I will do this to you not you doing it to yourself but I will do this. Moreover, I will give you a new heart question. Is it just the Jews or the Gentiles that have a new heart? Is it just the Jews or the Gentiles that has his spirit in us? He says and I will put a new spirit within you and remove the heart of stone from your flesh and give you a heart of flesh which is what Jeremiah just said also. He says I will put my spirit within you and look what he says. Cause you to walk in my statues. That kind of gets rid of the the whole problem there of someone wanting to walk away from him. Someone being involved in sin toward the sin brings them or breaks fellowship completely from God. They're going to walk in his statues and you will be careful to observe my orders. That's what's going to happen when the spirit is in us. Now, is that just for Jews or is it for Jews and Gentiles? When John 3 Jesus brings his exact same thing up and he says that a person must be born of those two elements that we see in Ezekiel 36 water and spirit. A person who's born again or born of the spirit born from above or born of the spirit and so it seems as though Jesus speaking of just the Jews and he is speaking to a Jewish person to a Pharisee that is Nicodemus but he also says that we're also told that this replies us because in John 1 12 as a matter of fact let's go there but as many as received him to them he gave the right to become children of God even to those who believe in his name. So those who believe in his name as many this word hasoi which includes not just Jews but Gentiles all the folks whoever it is that received him he gave the right to become children of God. So he's speaking of a holistically total in total all of those those who believe it which is the word is the Pistoshin which is those that are believing so all the ones that are believing in his name and look what he says those who were born not of blood nor of the will of the flesh nor of the will of man so it's not an ethnic born not of because they desire to do so nor of their own little wheel they're warning to but they were born of the will of God born of God that's all of us we know so because John tells us all of us that are believing are the ones that were born of God and going back to John 10 28 he says or 29 he says my father who has given them to me is greater so that no one can snatch them out of my hand the reason why that's important because if we go to John 6 let's go there also another one of my number one favorite verses he said Jesus says I am the bread of life he who comes or the one that's coming to me or command us the one that's coming to me will not hunger and oh by the way the word that's used here is may a double negation can I say which is this person will never ever ever ever hunger if you come to him well is it possible to hunger later after coming to him coming to him on a Monday what about next Friday no ever ever never ever ever will you hunger and he who believes this word is a hot pistol on that the one that's believing will never thirst if you are believing now you will never ever ever thirst but I say to you that that you have seen me and yet you don't believe all the father all pawn let's move this up on the greek side so you can see all that the father gives to me Jesus said in John 10 all that let's put it back on the screen so I want you to ask her to follow along with me he says my father who has given them to me given who sheep the father has given the sheep to Jesus are you with me so now he said he makes his statement I'm sorry wrong passage back to John 6 he says all that the father gives those are the very same sheep that the father's given he says they will come to me which is kind of indicative and emblematic and rings in to remember what he says in John 10 that them coming to him he says his sheep will follow they will follow they will simply not follow another voice he says all that the sheep give I mean the father give the sheep all the sheep all that he gives will come to me and the one who comes to me I will certainly not cast out I will certainly not cast here it is again this double negation of a subjunctive who may I follow so this rule is there too am I still misapplying the rule no I absolutely not I would love for someone to say no Cory you are applying this rule incorrectly come show us come demonstrate in the because I don't have a problem with being wrong we want to be right we want to follow what is right but we're not going to follow your guess your understanding or your misunderstanding or the fact that you don't know the word or I should say don't know the rule and because you don't know the word or don't know the Greek rule then for some other reason we're supposed to fine since you don't know it we should act as though we don't know it that's not right that's not as a matter of fact it's not very wise or smart to borrow pun that's not being a smart Christian let's figure out what we don't know learn it and apply it how about that notice what he says he says for I have come down from heaven not to my own will but the will of him who sent me this is the will of him who sent me that all that he has given who has he given the sheep all that he has given me I will lose none I will lose none but raise them in the last day now let's drop down to verse 47 and notice what he says as well John 6.47 he says truly truly I say to you that he who believes this is the hapistouan so the person is believing hapistouan the person that's believing has eternal life go to the right side the Greek eke this is present tense he has right now the one that's believing if you are sheep if you believe then what does he say right now you have zoane Ionian you have life forever you have life going into the age or actually the word is probably used you have life eternal or life into the ages so when do you have life according to Jesus unless Jesus doesn't know the rule unless I'm told I'm to believe that Jesus doesn't understand how to apply this which makes no sense Jesus states that if you believe if you believe you have at this very moment life going into the ages again if a person thinks that it's biblical that a person can lose their salvation find it in the in the bible let's get out of the habit of stating something is biblical if it's not in the bible if you don't have an example of what you believe then what you literally believe is unbiblical notice that I mean that the person is in sin they're not safe no you can be wrong and it not be sin for example if I get a math question wrong I'm wrong but is that a sin no I'm just wrong what would be wrong is to continue to stay in ignorance to be willfully wrong no matter what I don't care what you show me I'm not gonna believe it well now we've left being wrong and jumped over into pride Cory what about you no it's not that I'm proud now I'm proud of what God has done for me and that's since I'll boast about the salvation how weak I am but remember as I said before I used to believe and would fight people on the possibility of losing salvation I said that you could lose it you could always lose it but after a while just looking at the scriptures I could not do anything with it so my challenge again and I'll keep raising this challenge because it's just that important it is ridiculously important it's the one thing that he's given us that we can be secure in even if we go to to Hebrews 10 we've covered this even if we go to the passages where you think you can lose your salvation Galatians 5 or Hebrews 6 which says if you do lose it it's impossible to get it back but those are folks who just don't simply understand what the atonement is because that's what he's bringing up in Hebrews whatever passages you want to go to we've literally covered every last passage that people thought that you that states that you can lose your salvation we've covered every at least every one that's been brought up I should say it that way but no one has ever dealt with this one passage other than to say where you were applying it wrong how else could you apply it he literally says that his sheep the possibility of his sheep perishing will never happen there is no possibility of sheep ever ever ever perishing in the future his sheep will never ever ever ever ever follow a strange voice they will run away they will flee so now again one last time for the smart Christians that are out there or those that think that we're not that smart could you please intellectually run through the passages that I'm citing and tell me how I am misapplying the Greek to John 10 28 as well as John 10 5 as well as John 6 37 39 47 as well as even and I didn't break down the Hebrew but just the Hebrew if you want to of Ezekiel 36 25 through 27 tell us where we have parsed this incorrectly where we have executed this incorrectly and then you'll have something and I will apologize I'll come before everyone and say that I'm wrong so I have no problem with that I want to say what is right it's not about who's right but it's what's right and so because of this I think it's finally important why because that's what God has given us that's the gift that God has given us not tongues not being slain in the spirit not money in our bank accounts not health not none of those things and some of those things might be true might actually happen but the whole goal is salvation and don't you want to have salvation forever I should hope so


Howdy how's it going? My name's Davy Chappy and no, this isn't a re-upload. I just haven't made a lizard folk guide before, despite our collective unconscious believing it otherwise. What I have done in the past is talk about the lizard folk briefly in my guide to Volo's Guide to Monsters. But the reaction to do an entire video on the lizard people, and also the Kenku, but come on people, they're talking birds. That is their lore. Has pushed me to expanding my thoughts on the Scalies into a full-fledged lore guide. So, as always, keep in mind that a lot of this is just my opinion. So, if you feel like it's actually a good thing that lizard people run the country, feel free to run your games however you want. And real quick, I'd like to give a shout-out to my new patrons this month. Trevor Weirgau, Zalamancer, Thur, JT, Stevens, Nick, Tyler Gorzelski, Eric Schaefer, Cameron, Jared2312! Thank you so much for pledging to my Patreon. While lizard folk may not have any feelings in their cold, dead hearts, you can be assured that I have all the feelings for you. But with that out of the way, let's begin. So, lizard folk are the reptilian species of tribal seclusionists that want nothing to do with the rest of the world, and yet everybody still keeps trying to make fan art of them. The life of a lizard folk is one of total swampitude. As to evade the lustful eye of deviant art, they've parked their lizard societies inside of remote and desolate places like swamps, forests, and the Catholic Church's HR department. It's all lizard men there. And they do their best to ignore the rest of the world, and only focus on their own survival. Lucky for them, lizard folk are fans of Gloria Gaynor, and they will survive. Being part crocodile, the lizards have a very impressive biting jaw, and also like a crocodile, they're high deflex bullets. Coupled with the evolutionary knowledge that stick plus pointy equals spear, a single lizard folk can be coming out of its shell and it'll be doing just fine. And this makes them a completely self-sufficient society that really does not care about whether or not cannibalism is appropriate for the general audience. And this is just partly due to the fact that lizard folk are cold-blooded reptiles that can't really process emotion the same way that humans do. To a lizard folk, things don't hold sentimental value. It's either a thing that works or a thing that doesn't. A person is violent and you should react accordingly, or it is nonviolent and you should appreciate the simplicity. Either by leaving it alone or eating that person. This means that outsiders interacting with lizard folk will get the same crocodile smile for the entire time that they're there, and they'll never know whether that's meant to be a good thing or a bad thing.  Luckily for lizard folk, this lack of emotion tends to really help them in the mode of survival. Some lizard folk might be walking down a marshy trail when all of a sudden, oh my god, a frog chemist! Meh, a lizard folk doesn't care. It just registers that this is a dangerous threat, but lizard folk were born to no-no fear. If the lizard folk loses a leg in the fight, it'll register that this is a major inconvenience and that its dancing career is over, but it won't be upset so much as just disgruntled. The only thing that lizard folk seem to actually care about is dragons, as they see them as the leaders of the scaly hierarchy and they treat them as such. Much like Olimar whistling at a pack of nearby Pikmin, a dragon that stumbles into a nest of lizard folk has just acquired an accidental army of devout worshippers that will heed that dragon's beck and call because, well, there actually isn't a reason. Lizard folk just consider dragons to be both superior and also close enough on the fur affinity search index that they may as well just be friends because why not? It is worth noting that the language that the lizard folk use is draconic, implying that the dragons have helped their species grow and now the lizard folk are paying it back by being literal slaves, but as a 5e, that lore just doesn't really exist anywhere. What it does mean, though, is that you can usually tell if a dragon is in the area based off of whether or not the lizard folk actually acknowledge your presence.  Beyond that, the lizard folk don't really play a part in the history of the world, spending their lives being born, wandering around for a while as little sociopathic children, which is to say children, and then growing into one of three positions within the clan. The first position is where the vast majority of lizard folk end up, so it doesn't get a name, you're just a lizard folk. Your job is to ensure the survival of the clan by hunting, foraging, crafting, and fighting for the survival of your people. There are no specialties in lizard folk culture.  But if you want to be more equal than everybody else, then you have the option to go the route of the shaman.  Although, I guess that sort of makes sense when magic and gods 100% for real exist, so it's worth picking up theology as a survival tool. In any case, these shamans ensure that the tribe follows the xenophobic ways of the lizard folk god Semuanya, who blesses them with knowledge of crafting, hunting, and seasoning people who wander too close to home. If Semuanya finds their worshiping to be worth Gordon Ramsay's seal of approval, then they might boop one of a clan's little lizard babies before it hatches out of his shell, granting it the powers of a super lizard and ensuring its rise as the king or queen of a tribe. But shamans need to be careful, for if they are unfaithful in their shamanistic ways, they might hear the call of Cess Enoch, the evil lizard folk god, that heard that lizard folk are easy to enslave and wanted to get in on that action. When Cess Enoch takes over a village, they send down a prophetic envoy by way of booping their own little lizard baby, and while that child will carry the same strength and power as one touched by Semuanya, it will soon prove to be wicked at heart, and it will spiral the clan down a dark path of raids and general bad vibes for which the lizard folk are so often stereotyped. And it's that stereotype that keeps the rest of the world and arms length away from anywhere that the lizard folk have decided to set up shop. Most races want nothing to do with the lizard folk, and considering that the crocodiles can only be found in the remote alleys of Skype messaging systems, they're not inclined to change that view. The only time that humans, elves, dwarves, and all the other fantasy races of the world ever interact with the lizard folk are when they are either forced to, either because the scalies park their home in the elves backyard, or because the local farmer can't go out and collect his beets without getting attacked by a Spider-Man villain. In either case, the usual response is pretty straightforward. Kill them all and let God sort them out.  Lizard folk aren't bad by nature. It's their analytical minds that mean that, yeah, they are likely to see a person wandering into their swamp and think, ooh, food, but when they're faced with an opposing threat that can either wipe out the whole clan or just be enough of a problem that staying there is unfeasible, the next logical conclusion is to seek peace with the angry peasants, either by agreeing on clearly marked borders that neither side will cross, or even deciding to go as far as to be friends and trade goods. This, honestly, is the best outcome that you could have with the lizard folk. Since lizard folk fight for their clan, and if they consider you an ally of their clan, then they'll fight for you, too. And there is nothing better than having a friend that considers you an absolute snack. But then I'm about to do it. I hope you enjoyed this video. Be sure to like, comment, subscribe, check out all my social media in the description below, check out my stream later tonight on Twitch, and maybe support me on Patreon so that I can make an omelet out of all these lizard folk eggs. But yeah, Davi out.


Last size seems to dwindle week by week. Maybe we'll need to do something about this. As it dwindles, maybe you guys can in the back and like come up front. There's lots of room that way. I won't burn so many calories walking back and forth. Can you please? This is my line in the sand today, right here. Five rows from the back. You guys? You? Yeah? Yeah, yeah, I know. I know you're right on the border, but that is the border. No, you've got to move forward.  Morning. All right, so today, this week, we're going to talk about scheduling. We basically, we started this unit about the CPU kind of right at the bot. We talked a little bit about some of the things, issues with the CPU that the operating system is going to try to correct. We discussed some of the abstractions that we create in the operating system to do that. And today, we've kind of reached the top level, right? So we started at hardware. We built up some useful abstractions. And now, we're all the way up to the policy level, where we're going to start talking about how we manage these abstractions we've created and also some of the ways that we try to get good performance out of the system. So this is kind of, this is it. This is the last hurrah for the CPU. Once we talk about scheduling, we're going to be finished. So this week, my goal is today to introduce you to scheduling, kind of talk about some of the goals of scheduling. Now, some of the presentations of scheduling, I've seen don't really do this. They just kind of like jump right into simple scheduling algorithms. But I think it's worth slowing down a little bit and talking about what are the goals of scheduling and also how do those goals connect with the way that you guys use your computers, right? So this is a place where you guys can actually use some of the intuition that you've built up as actual computer users to think about how this stuff works, right? And I lost a slide, so yeah, I know. It's just, there's always one thing in the morning that I managed to forget. All right, cool. So and then on Wednesday, we're going to talk, we're going to go through kind of a rapid fire introduction to a bunch of simple scheduling algorithms. And we'll talk a little bit about some slightly more complex scheduling algorithms and some scheduling abstractions, right? So some abstractions that we use in the scheduling process, things we might assign to threads, different ways we might think about how threads compete or vie for the CPU or different pieces of information that we might want to store along with the thread in order to do better scheduling. And then on Friday, what we'll do is we'll spend one class and we'll look at a real scheduling implementation in a little bit of detail. And that'll be the Linux 01 scheduler. And then after that, we'll also talk on Friday a little bit about issues with multi-core scheduling, which is kind of interesting. This is new. I'm trying to keep this class new and up to date, right? So most machines now, including even low-end phones and tablets, are going to have multiple cores in them. So multiple core scheduling is kind of where it is. And there's some interesting issues that arise in multi-cores. So any questions about the plan? OK, a couple of announcements. So Assignment 01 is out. How many people have started the assignment? OK, awesome. That's good, because you have a week and a half and I get going. And again, so the last thing I need to do today or tomorrow is to just finish describing how we're going to do the testing. And I've kind of reversed myself on that, but I'll update the website once I finish what that means. Week from Wednesday. Yes, yes, at 5 PM. And look, I'm working on getting the slides up online. I get a lot of emails about this. Some of the tone of those emails is a little irritating. I understand that you guys want to have the slides. And I am aware of the fact that I would like to put the slides up online. One of the reasons I stopped doing it is if you go to that page, it takes 10 or 15 seconds to load at this point. So the way I'm putting up the slides online is not scaling, so I need to fix that. They're coming, but sending the emails like, put the slides up online is not a good way to build a beautiful, long, and wonderful relationship with me. I know that the slides need to go up online. I don't appreciate getting little orders over you, but they're coming. And hopefully that will satiate people for another five or six hours so I can buy myself some time to work. All right, so let's talk about last week. Last week we talked about synchronization. Synchronization week, right? You guys have an assignment that is out right now that is on synchronization. So any questions arising either from the material that we went through or from the assignment or from the depths of your fevered imagination? Anything, any questions about synchronization? Anything, anything. So the assignment is just easy, straightforward, no problems. OK, so let's do some review. Starting in the back here. Concurrency is the illusion that multiple things are running at the same time. Yes, everything even. Everything would be great. Atomicity is the illusion that you're not sure. OK, let's keep going. Atomicity, what is atomicity? Concurrency is the notion that multiple things are happening at the same time. Atomicity is everything is isolated in what sense? It has something to do with safety.  I'm working the back of the room. Eh, not quite there. Do you want to help her out? Yeah, we're trying to run out the clock back here. Robert, you want to help these guys? That you by yourself. So that's part of doing this. But what is atomicity? Right, atomicity is the illusion that something that actually takes multiple instructions, multiple changes to stay down the CPU happens all at once. So there's no way to observe it at any point in between. I either see it, I have a bunch of changes I need to make to some shared state. And either a thread sees it before I make those changes or after I make all the changes. So this is atomicity. Questions about this? It's important to understand this distinction, particularly these definitions. OK, so let's talk about the assumptions that you cannot make. So people where they're settling here in the back, I've encouraged everybody today to move forward, especially you Vishwa. I like having you up in the front. Here, come up. While you're moving up a few rows, can you tell me one of the things that we can't assume anymore about threads? Unless explicitly synchronized threads may, why do we need synchronization? So that the access to shared resources is constrained. Right, right. But when I'm looking at code, when I'm looking at what a thread's going to do, what can I not assume about that? Yeah. So I can't assume, so I have to assume that the threads can be run in any order. So interleaved execution is your new reality, especially for assignment one. Yeah. Also they can be started and stopped at any time. This is preemptive context switching. What else? I heard it. Yes, they can be stopped for an arbitrary length of time. OK, I think that's it. All right, let's talk about some of the synchronization primitives we talked about last week, OK? Locks, what is the interface to a lock? Two functions, right here. OK, get, which, OK, acquire, and then what's the other thing I do with the lock? Release, acquire and release. And acquire will sleep, and that's still wrong. Dang it. I shouldn't have cut and pasted it. I'm not going to jump up and down again, but you guys know what lock release does. Cut and paste fail. OK, so yes, lock release will drop the lock. Lock release will not sleep, right? Look at me. Don't look at the slide. Look at me. OK, what are locks for? What do I do with the lock? Right over here. Mature exclusion, or what else do we call that? Critical sections, protecting critical sections. I acquire the lock at the top of the critical section, and I drop the lock when I leave the critical section. And dropping and acquiring the lock defines what the critical section is, right? There's no notion of a critical section if you don't protect it using a lock or some sort of other device for ensuring mutual exclusion, right? If you don't do that, then you don't have a critical section. You just have a bunch of stuff that may or may not happen in any order, OK? What's the interface to a condition variable? Three functions. Let's see if we can get one at a time right over here on the right. One, one out of three. No. Next, next, right here. What's the interface to a condition variable? Signal is one of them. OK, what else? Weight and? Right here. Signal, weight, and? Post? Post sounds like a fun call, but I don't know what it does. Broadcast, OK. Signal, weight, weight, signal, broadcast. Weight, weight, sound the condition variable until the condition changes. Signal, signal is one thread that the condition has changed. Broadcast signals all threads that the condition has changed, OK? What do I use a condition variable for? Anybody. So the condition variable provides a more flexible signaling mechanism than locks do, right? With a lock, really I can only signal implicitly that a critical section is available or not available, right? Condition variables allow me to signal that a condition has changed, right? And that condition is usually encapsulated in a what? In change to some shared state, right? It's a condition variable, right? The condition is that the variable has taken on some value, right? Or stopped taking on a value, right? Why are condition variables always associated with a lock? Anybody? Yeah? Because of the shared state, right? The lock protects the shared state, OK? And also the lock allows me to tie together any changes I make to the shared state and the signals that I'm going to send to other threads, right? And if I don't do that, the shared state actually might change in some other way, right? So let's say I'm the last, let's say the buffer is full, using our example from last week, and I'm taking an item out of it. If I take out the item, I've changed the shared state. Maybe I use a lock for that. But maybe I dropped the lock before I signal threads that are waiting to produce into the buffer, right? The problem is that in between the time I drop the lock and I send that signal, another producer may have run and already put something in there. So the condition that the buffer is available may no longer be true, right? And that's why we use a lock. That's why the condition variable interface requires that in order to signal and broadcast, you hold the lock, right? Because it ensures that the state that you are signaling hasn't changed. OK, questions about CVs, condition variables. You guys are going to have to use these on assignment one. Build them first, right? That's the fun. OK, deadlock. Deadlock occurs when what? What's the definition of a deadlock? Let's see here. What about right there? Definition of deadlock. Yep. Don't remember the exact definition. What's that? Right, so and waiting in cycles, will that wait ever stop? No. So waiting is when a set of threads are waiting for each other to finish. And because of the cyclical nature of that, as you pointed out, no one will ever wake up, right? So a deadlock is usually a very serious condition, right? Because there's no way to wake up the threads, and there's usually no way to break the cycle, right?  Which could have all sorts of other weird consequences. Four conditions for deadlock, right? This is from last Friday. I know that was a long time ago.   So deadlock and atticker, four conditions. Anyone want to give me one? There's already one that's floating around the room, yeah. Right, so if I can take a shared resource away from a thread, then I can break out of a deadlock. Any deadlock, right? So that's one condition. What's another condition? Protected access to shared resources, right? So I actually have to, you know, if I don't need a lock to access a shared resource, because I've done some tricky thing with the resource itself to make sure I don't need a lock, then I don't need a lock. And then I can't ever deadlock, all right? Three, cyclic dependency, right? I need a cycle in my dependency graph, OK? And fourth, one more. We're really close. What's that? Priorities? No, that's not the one I'm looking for. Fourth, yeah. Multiple, and what does that mean? So what it means is that I can hold one resource while requesting another, right? If every time I needed a resource, I had to surrender all of their exclusive access to resources I held, then I can never deadlock, right? If I only hold one resource at a time, there's no way for me to deadlock, right? And last win, run small catch to this, right? A single thread can deadlock. How? It cries to be required a lock that already holds. OK, good. I attempted to require a lock. OK, good. So back to the top. Your questions about synchronization, right? Have people started to look at the synchronization problems, the little toy synchronization problems that we gave you on the assignment? Who's looked at those, OK? Who's chosen a synchronization primitive to use to solve them? OK, now we're getting into the drugs. OK, get started on the assignment, right? Because you guys actually have to implement those before you can even use them, right? So the first part of this assignment is building your synchronization primitives and getting them to work, OK? The second part is actually using them to solve the problems, right? So you guys aren't even going to get to those synchronization problems until you have primitives that you can use for life. Do you have a question? Yeah. Signal and broadcast, right? So if I have n threads that have slept on the condition variable, right? So they are waiting for the condition to change. And I call signal. The system will wake up one of those threads, only one.  And this came up, I think somebody asked about this toward the end of last class, right? So in general, I guess what I would say from a programming perspective, broadcast is safer. Because let's say I have a condition like the one that we discussed in the example that we did on Friday, which was that I had a buffer, and the buffer could be in three states. And I could have potentially, depending on the ordering in which threads run, I could have threads waiting on the condition to change. Some of them are producers, some of them are consumers, right? So some are waiting for one condition, some are waiting for the other. If I use CV signal, all I know is that I'm just going to wake up one thread. But I have no idea what thread is going to wake up. And unless you can really convince yourself that the thread that wakes up is always the right thread to wake up, then it can be safer to use broadcast. What's the problem with broadcast, though? Anybody? Venu?  What's the problem with broadcast? Signal wakes up one thread. Broadcast wakes up all threads. What's that? Well, yeah. I'm cabling an answer here from parts of multiple answers. What's that? Well, right. So the first thing, remember, CV weight drops the lock, but when it gets up, it holds the lock. So the first thing CV weight has to do when it gets up is hold the lock again. So now I've got n threads that are banging to get into the critical section. And in many cases, what are many of those threads going to do again immediately? They're just going to call CV weight again. Because they're going to wake up, they're going to check the condition. The condition has changed, but it hasn't changed in the way that they wanted. Or maybe it changed, and by the time they woke up and checked, it changed back to the way that they had originally caused them to wait. So yes, broadcast will wake up all the threads. And each thread will have to reacquire the lock, check the condition. And in many cases, many of those threads will immediately go back to sleep. So you're paying the overhead of all that extra context switching and all those extra mechanisms to in order to perform the broadcast. On the other hand, again, unless you can convince yourself that signal will always wake up the right thread, or a thread that can actually do something helpful based on the condition, then it can be safer to use broadcast. Pay the penalty and get it right. Any other questions? This is a good question. Any other questions about synchronization? I'm not going to tell you how to implement it. So my advice is to read the assignment and then to go look at how semaphore is implemented and to use many of the things that are already there. But you may have to build some new features to do this. One of the things I'm doing about the testing, the original testing scheme was to have you send us a couple files. I think we're actually going to invert that.  And we're going to replace a couple files. But I want you guys to feel free to, for example, modify stuff in thread.c. If you want to change the primitives that we've given you, some of the ray stuff, whatever. Again, it's your kernel. So there's a small set of changes we will have to make for testing. But other than that, it's up to you to do that. So I'm not going to promise that all the functionality that you need to wake up and have threads go to sleep in the way that you will need to implement CVs is there. It might be, but I can't remember. So today we're going to talk about the schedule. Yeah, that's all right. I just had a question about the project. How are we going to test? That's a good point, actually. So OK, good point. So we will probably have to require you to use a particular set of names. So I'll change the assignment to make sure that you guys use the set of names. And I'll give you what the interface is. Because we have a testing code for that, that we're not going to release. And as I stated in the assignment, this is an exception to our usual stated policy of giving you guys the testing suites that you need. But in this case, it's because we want you to build a test yourself. But you're right. Yeah, we do need to figure out what that interface is and standardize on the name. That's a great point. Stuff I don't think through. OK, any other questions? All right, so again, so today we're going to talk about scheduling. We're going to focus on scheduling this week. So we've talked a little bit on and off about scheduling. And I think you guys know this. And that's a good chance for us to review some of the stuff that we've done in our sort of CPU thread unit. So what is scheduling? Anybody want to venture a guess? What is for? OK, so now you're telling me what scheduling is trying to do. But what is it? Just like, what is scheduling doing? OK, so scheduling is going to use the mechanism of context switching. OK? It's switching between threads. Forget the time run up for now. Scheduling is just when the operating system has a choice about which thread should have access to the core or cores, how do I choose which thread will run? So it's the process of choosing the next thread or threads to run on the CPU or CPUs. Again, for most of the next day and a half, I'm going to talk about this as if it's a single core system. Some of the algorithms that we'll talk about will generalize easily to multiple core systems and others don't. And there are some other interesting issues that arise in multiple core scheduling. And again, we'll talk about that in a Friday. And I just said that. Yeah, good, OK, I get ahead of myself. All right, so next question. Why do I need, why schedule threads? Why is this necessary? Fundamentally. Right, I've got this illusion of concurrency. And the illusion of concurrency is based on the reality is required because of the reality that there are more threads than there are processors. And so I have to make a choice. If I had a core for every thread on the system, I wouldn't have a scheduling problem. I would just hand out, I would say to each thread, I'd say here's your core, go have fun. And you never need to stop running. So I never need to make this choice. So again, this scheduling is the policy of how we implement this abstraction of concurrency. And this goes back to our earlier discussion about multiplexing and why the kernel needs special privileges. So this is another case where I'm multiplexing the resource, I'm dividing up the core cores that I have between the threads that are active on the system. And in order to do this, I need these special powers. So the kernel needs to be able to tell a particular thread, you're done, you're not going to run anymore for now. I need to use the CPU for another core. And this is one of those things that applications submit to as part of running on the system, is allowing the CPU, sorry, allowing the operating system to gate their access and control their access to resources, including the CPU. Any questions about this? This is review going back a couple of weeks. I thought it was kind of good to talk about. OK, when does the scheduler run? OK, when the timer interrupt goes off, when else? There's actually, I've got four things up on this slide. That's one of them, right? When else does the operating system get to schedule a thread? OK, so context switching is the mechanism, right? All of these involve a context switch. One at a time. Yield. Good, OK, we're going to talk about yield on the next slide. We haven't really talked about yield yet, but I'm going to talk about yield. So yield is when a thread will actually say to the operating system, hey, I could keep running, but I don't want to. I'm going to let you make another scheduling decision. I don't need your help with anything right now, and I'm not necessarily waiting for anything to happen, but I just kind of want to be rescheduled.  OK, yield, hardware interrupt, sorry, timer interrupt, what else? And how do I block for input? When a thread asks the kernel for help with something, right? When the thread makes a system call. Because I trap it to the kernel, I context switch into the kernel, and now if the kernel wants to, it can stop that thread. Now, whenever I make a system call, whether it's a non-blocking system call that can return immediately, or a blocking system call where the thread has to wait until something happens, I have a chance to make a scheduling decision, right? Because the operating system has started to run, OK? In the case where it's a blocking system call, I have to schedule another thread, right? Because that thread cannot be run for some period of time until something else happens, right? A disk IO completes or whatever, yeah. When a thread exits, all right, you guys are good, right? Got all four. Voluntary yield, which again, we're going to talk about on the next slide. Blocking system calls, thread exit, and when the kernel decides that the thread has run for long enough, and the way that this is implemented is as Ben pointed out, through a timer interrupt, right? So number four, now I can have, you know, depending on the system, I'm trying to think of if I would have some mixture of one through three, but I would probably have, definitely have one through three, right? When a thread exits, clearly I need to run another thread. When a thread asks me for help, especially if it's a blocking system call, I definitely can't run that thread, so I have to choose something else to run, right? And if a thread calls yield, then again, what it's asking me to do is to stop it, right? So I should probably do that, or at least it's giving me an opportunity to stop it, right? The existence of number four is what differentiates preemptive and cooperative scheduling policies. So on a preemptively scheduled system, the kernel can stop a thread at any point, right? Whether or not the thread has asked to be stopped, exited, or made a blocking system call, and we talked about the mechanism for that, and can someone remind me what it is, Ben, just said it. How do I implement preemptive scheduling? How do I give the kernel a chance to run? Through a timer, right? So the timer and up causes the system to trap into the kernel, and at that point, I'm allowed to stop the thread that's running and choose something else to run, OK? So if number four exists, I have a preemptive scheduling policy. I can stop a thread that hasn't asked to be stopped. Number four doesn't exist, and I have a cooperative scheduling policy. And the points that the kernel is allowed to make scheduling decisions are on some level determined by the applications themselves. So an application that sits in a while one loop for a long time may not ever give the kernel a chance to make another scheduling decision. So that could be bad. That's why we have preemptive scheduling, OK? So let me talk about yield just for a sec, because this hasn't come up earlier. So kernel threads, and I don't know if there's actually an interface in the standard Unix system call interface, if there's a call to do this. But I wouldn't be surprised if there is. But particularly in the kernel, kernel threads can call a function called thread yield. And yield is essentially a way of, we talked about before, how threads transition between different queues, right? So if I make a system call, I go from the running queue to the waiting queue. Yield is how I move from the running queue to the ready queue directly. And I do that voluntarily. I say, again, for right now, I don't need your help with anything, but I would just like to be stopped. And this could be a good thing. I mean, if a thread woke up, it checked whether it had any work to do. It didn't have any work to do, and it doesn't have anything else to do. So it essentially says, hey, I'm finished, and I would like to yield. So this is a voluntary mechanism, allowing well-behaved threads to tell the CPU, hey, I don't have anything else to do right now. So if you have another thread to run, then that would be a good thing to do. And yield is essentially a cooperative mechanism. It allows a thread to explicitly tell the kernel that it's not doing anything important anymore. You may not, the thread may not have anything else to do at all, right? Okay. So let's talk about policy versus mechanism, because we've come to the point in our discussion of the CPU where this split is nice and clear, okay? So we talked a little bit about early in the class how one of the goals of the system is to separate policy and mechanism, right? And separating policy and mechanism allows me to separate their implementations, right? Allows me to, for example, write a variety of different scheduling policies, right, that decide how to choose the next thread while relying on the same fundamental underlying mechanism. So yeah, the kernel makes that decision, right? You're essentially telling the kernel, I'm done for now. I'd like to be like, I'm still alive, right? I'm not blocked waiting for something, but you decide when to run me next, right? So that's one of the things about yield. You don't have that, necessarily have that control, okay? So let's talk about, and we've already talked about this stuff, right? We spent most of this unit talking about mechanism, right? We talked about context switching, we talked about thread abstractions, which are a way of organizing information that's necessary to do some of this stuff, right? We switched between threads by moving it between these cues, right? Those cues are abstractions, but moving this, putting things back and forth, this is all mechanism, right? The context switch is mechanism, right? And now we're gonna talk about the policy. So this is gonna be what we're gonna do this week. But let me just go through this because I wanna make sure that this split is really clear, right? Because the fact that this split exists is a really useful design principle, right? Okay, so, deciding what thread to run, policy or mechanism? Policy or mechanism, anybody? Policy. Policy, who said mechanism? Why? Right, right? But that determination itself is a policy decision, right? Okay, so maybe we can contrast this. Contact switch, mechanism, right? Maintaining the ready, running and waiting cues, mechanism, right? What about if I have something that gives preference to interactive jobs? Policy. Using time run-ups to stop running threads, mechanism. Choosing a thread to run at random, policy. Okay, good. I know you can tell by the indentation, but you weren't supposed to. I know, I'm only, I only have so many skills, okay? I did think of that though. And I actually, originally the slides had policy and mechanism, but then it was too obvious, right? So you're right, it's still a little. Okay. The last thing I wanna impress on you is you guys look into this. And this is gonna be hard to really drive home because unfortunately on OS 161, we've never had great workloads that will bring out different features of scheduling. So for assignment two, we're actually gonna ask you to write an experiment with a couple of simple thread schedulers, right? The problem is that we don't have a realistic workload that allows you to say, oh, this thread scheduler is way better than this other one, right? So I'm just gonna have to try to argue this from first principles, right? The fact is that how the CPU is scheduled and how I make this decision is really incredibly important to how the system runs. Why is that, right? And why in particular is the CPU so important to schedule, right? There's all these other parts of the system. Why is the CPU so critical? How do I do the CPU right here? Yeah, you don't know. What about working down the road toward the code rack? He doesn't know. Why is the CPU so important? It manages all the other devices. That's close enough. I don't know, but so if I wanna use the disk, what do I have to do? I have to use the CPU, right? Well, I don't know if it's the main computer, but the computer I think is the whole collection, right? It's required to use every other device, right? If I wanna use memory, I need to use the CPU. If I wanna use the disk, I need to use the CPU. If I wanna use the network card, I need to use the CPU. So this, how I schedule threads determines their access to essentially every other resource on the system, right? We'll talk later about how I divide up other resources like memory, for example, right? But a thread that's not scheduled can't use it to memory. So there might be memories sitting around, waiting for it, where it's stored stuff that it wants to come back to, but if it doesn't have the CPU, it can't use it. It can't request more, et cetera, et cetera, right? So this is why CPU is scheduling, it's having such a huge impact, okay?  Intelligent scheduling will make your system seem really fast and responsive, even if it's like an old, I don't know, I mean, old 386 is probably just don't seem responsive anymore, period, right? But, you know, maybe if it's an old, like, you know, at least sort of late model, penny and four or something, right? Depending on what you're doing, I mean, if you have a smart system, right, and allocates resources well, it'll make your system seem really good.  Really slow and sluggish, yeah. How much of it depends on the scheduling process and the code and... Again, I mean, one way of thinking about it is that the hardware inside your computer is not changing, right? So once you buy a computer, you have a fixed set of resources. And at that point, it's all about how those resources get used, right? You're right that to some degree, I would argue that the computer systems community has gotten out of having to write really sophisticated schedulers. And the reason is that hardware just has kept getting so much faster, right? So hardware has kept biggling us out, right? You know, you get this new version of Microsoft Word and it's slow and terrible, and then you get a new machine and it runs okay for a couple weeks, right? So that's kind of like, that's been the story of technology. Now, some of those curves are starting to flatten out, right? So I think it, and especially on mobile devices, right? I mean, some of those curves are really much more battery dependent than they used to be. The point is that, yes, to some degree, hardware has continued to move the bar, right? So yes, if you have a system that has a dumb scheduling policy, the best way to make it better is to add some more, you know, or a good way to make it better, or a guaranteed way to make it better is to add some more RAM or add a faster processor or something. Okay. So this is how I decided to break down kind of the interaction between what you expect from your computer and what the scheduling discipline provides, right? So I wanna start with kind of how people use their computer, how you guys use your computer, and use that to evaluate the different scheduling disciplines, okay? So when you're using your machine, I think that there are three, this is my taxonomy, but I think there are three things that we expect from our computers, right? The first is that when I do something, it responds, right? It's responsive. When I click on something, it indicates that something has happened, right? It may not finish what I ask it to do immediately, right? But it gives me some feedback that says, oh, I've started that or maybe if when I'm asking it to do seems pretty easy, it finishes rapidly, right? The second which I think is interesting and more a function of media on computers is this idea of the computer continuing to perform some regular tasks in a smooth and well-defined way, right? So what's an example of something like that that you guys do all the time? Watching video, for example. MP3s, audio, things like this, right? So these are examples of something and I kind of think of this as active waiting, right? I started something and I'm paying attention, right? I'm not interacting with the computer but I will notice that the computer doesn't do a good job of scheduling, right? If the audio starts to skip, you know, if the video sits there and starts buffering or starts getting old choppy or whatever, you will notice that, right? Despite the fact that it's not really interactive. In the usual sense of it, right? And then the final thing I expect my computer to do is to finish things that take a while, right? So, I think sometimes there's two kinds of things we ask our computers to do. There's the ones that we're willing to wait for and then there are ones that we're not willing to wait for, right? And that we just expect to happen overnight.  And I didn't spend 13 hours staring at the progress bar, right? I probably, you know, 10 years ago I might have. But now I've kind of come to this attitude where it's like, you know what, computer? Like, that's fine. You know, I'll forget about this as fast as possible and then maybe when I wake up in the morning you'll be done and it just finished like 15 minutes after I woke up, right? So it was like, okay, it really did take a while, right? So let's talk about how these expectations nap down into scheduling policies, okay? So again, responsiveness. When I give the computer input, it responds in a timely way, right? It may not finish the thing I asked it to do but at least it gives you some, you know, feedback that it started, that it kind of understood what you wanted it to do, right? And this constitutes most of what humans do with our computers, right? Most of what we do with our computers is interactive activities, right? There's actually much, much fewer examples of the other two here, although they might be equally important. And think about it, I mean, that's kind of what makes computer, entirely what makes computers different than television, right? Television is totally passive, right? Computers are interactive, we expect computers to do that. Television, okay, if you change the channel you expect it to do something. So give me, I mean, this is obvious stuff but give me some examples of responsive tasks, right? What's something that you would do that you expect the computer to respond to? Robert? Exactly, right? So, you know, web browsing, when I click on a link, starts to retrieve the webpage, right? If I'm editing, I'm typing things at the keyboard, every one of those keystrokes creates more data that's being read by that program and displayed on the screen, right? And then chatting, right? If I hit send, I actually want the chat program to do that, right? And when these programs violate our expectation it gets very frustrating, right? So I've been using a Google voice chat program for the past three, four months and I like it on some level, but it has this irritating feature where maybe 10% of the time when you type a little text message and hit send, it takes like 10 minutes, right? So I'm sitting there spinning, right?  You know? And so, I've realized that it actually does finish, so I just put it back in my pocket and wait for it to get done, right? But for a while I would wait for 10 seconds and I would kill it because I would think it was broken or something. Probably it is broken, there's clearly something broken about it, right? But yeah, so when these programs violate our responsive expectations using the computer becomes very frustrating, right? All right, so again, continuity, right? Continuing to perform some task that has deadlines, right? Over time. And as I pointed out, as we started to use our computer's media devices, this is more and more important, okay? And examples of this we already kind of went through, right? But I like the top one, right? Blinking the cursor, okay?  But if you were sitting there at your computer and you had a terminal window open and you hadn't disabled the blinking cursor, which I very kindly did for all of you on the virtual machine that you're using for this class, right? Because for some reason, a bunch who now has a blinking cursor by default, which reminds me insane, right?  Like you'd be like, what is going on, you know? You'd start to poke around and there's some big background process that's running a killing of anything. So anyway, so this is an example of something as dumb as it sounds, right? That really does, you know, your expectations are that cursor is going to blink really, really regularly, right? Playing music or movies is another thing, right? I mean, there are buffers on these cards, but they're small, right? And so on a regular basis, I've got to feed more audio data into the buffer on that audio card so that it doesn't stop, right? Or skip or do something else, right? And then little things in JavaScript on your web browser, right? I mean those, again, that have some sort of regularity, okay? And then finally, these background tasks, right, are completion oriented. I couldn't find a good term for this, so I used three interchangeable. And completion implies this passive waiting, you know? Like you've asked the computer to do something and you kind of want it to finish at some point because if it doesn't finish, it's really going to get annoying. But in the meantime, you maybe want to use your computer for other things, right? You want to watch a movie, you want to continue to interact with it, right? You don't want it to just shut down completely, you know, until the background task finishes, right? Until I finish my backup, this thing just stops, right? So other than backup, can anybody think of other examples of these kind of tasks? What's that? Installation is a good one, anything else? Virus scans, yeah, exactly. And a lot of these are not user initiated, right? A lot of these are initiated by your expectations about how the system runs, right? So for example, a system backup, I've set up my system to backup at certain intervals and I just want that to happen, right? Indexing files on your computer, I think is a good example because why do you do, why does your computer do this background indexing? Why? Because when I search, it's fast, right? Like it's essentially front loading a task. So when I start, you know, typing into the spotlight bar on my Mac, things come up really quickly. The reason they come up really quickly is not because it's doing a live search, it's because it's already built the index, right? While the computer is sitting there, you know, serving a slideshow or something like that, okay? So, and again, I mean most applications combine some mixture of these activities, right? So a music player, you know, changing tracks, that's a quick responsive expectation, right? You know, playing the track is the watch and then the finish oriented task is updating album artwork, right? That's just supposed to kind of happen, right? Without my really noticing. Web browser, follow the link, play web video, index my searches, right? So any questions about this taxonomy? I'm hoping that this maps down well to the expectations you guys have about how you use your computers, right? So, now going back to scheduling, right? So the idea of scheduling is what we're trying to do is we're trying to balance, right? Two things, one is meeting deadlines, okay? And I'm gonna talk about how deadlines are involved in two of these user expectations in a second, right? And the other is optimizing resource allocation, right? So here's a little brain exercise to help you think about how these two things compare, right?  And, you know, every week it's kind of like, you know that there are these ongoing tasks, you're building a new feature for the site or whatever.  How am I gonna plan out my week and kind of optimize my own resources so that I get a lot of work done on these tasks that I'm trying to finish, right? Okay, and you sit down, you do that, and you've got everything all in place and you're kind of working away on whatever feature it is that you're working and you're interacting with other people and there's a lot of different resources you have to use.  You need to fix that right now, okay? And then this really nice plan that you had for the week, the really nice plan that you had for the rest of your afternoon, the concert tickets that you had for that night, the, you know, reservation that they're really hard to get into restaurant in San Francisco that you made, it's all over, right? Like, you are ASAP, get this thing done as fast as possible, doesn't matter, right? So, and systems are kind of constantly torn between these two things, right? On one hand, in order to get some of these background tasks done and to do a lot of other useful work, they're trying to carefully allocate resources, but then when you click on the link, it's like, well, okay, you know, perception delay, I've got five seconds to redraw the screen and then I've got to go get this webpage, right? So that's, you know, think about your computer, you know, you're sitting here in class and it's kind of sitting there being like, okay, man, I'm planning my next five minutes, I'm gonna do this, I'm gonna do that search indexing, et cetera, et cetera. And then things get boring in class and you start looking on YouTube and it's like, well, you know, now I have deadlines, right? And I think of, you know, responsiveness and continuity are about deadlines, right? Responsiveness is about meeting unpredictable deadlines.   Continuity-based tasks are a little bit different, right? Continuity-based tasks establish a set of deadlines in the future that the system now has to meet at regular, right? So that's the difference. When you start playing a video, you've essentially set up two hours with the small little deadlines for your machine that it has to meet, right? And if it doesn't meet one of those, you'll get irritated, right? Because again, the movie will stop or skip or whatever, okay? Throughput on the other hand and being able to finish these completion-oriented tasks requires this careful resource allocation, right? So this is, in my opinion, this is the big, you know, this is the big tension in scheduling, right?  Well, at the same time, it does a good job of optimizing its resources. Here's the thing though. Humans notice deadlines and responsiveness, okay? You notice if your screen stops refreshing, right? You notice if the movie skips. What you don't notice is resource allocation and how effective it is, right? So for example, you hear people say this all the time, my computer feels slow, you know? Like, my computer's feeling a little sluggish, you know? I think I need to take it to the Mac bar so they can like, you know, scrape some mud off the tires or something. I don't know. Has anybody heard anyone ever say this? Okay, you've got dork friends. That's good.  Okay, okay, so I think my intuition is that this is a much less common thing for somebody to say, right? Most of us have really very little idea on a day-to-day basis how many resources our computers are consuming. We just don't know, right? I hope that things using all of its RAM. I don't know. I have no clue. All I know is that it's not as fast as it used to be, you know? It doesn't feel fast, it feels sluggish, right? So, and again, and this is fundamentally going back to that thing that we talked about before, right? Your time, computer time. Responsiveness wastes your time, okay? That's irritating, right? And your time is actually really important, I would argue. And the poor throughput is just the computer time, right? So, you know, my computer last night had to work overtime to finish that back up, right? I don't care, you know? I, you know, it's, it's, it doesn't make very much an hour, right? I don't know what electricity costs to power that thing, but it's not that much. So, this is, so as we talk about schedulers starting tomorrow, right? This is how I want you guys to think about how do you, how we evaluate schedulers, right? Can the scheduler meet deadlines, right? Can it meet unpredictable or continuous predictable deadlines? And how well does it completely and fully allocate system resources? And as I talked about before, how I allocate the CPU has a big impact on how the rest of the system resources get allocated in use, right? And again, on human-facing systems, interactivity is almost always wins. There's usually big, big sort of biases in the direction of interactivity on these types of systems, right? Because, you know, humans don't want their time wasted and your time is much more precious and in some ways meant much less compressible than computer time, right? Okay, just one quick note here before we leave. So, I'm not gonna talk about real-time scheduling because there's a whole class here that looks at real-time operating systems. But, again, so we've established that deadlines are important, right? And deadlines are important because when computers don't meet deadlines, human users get annoyed, okay?   So on real-time systems, you know, like deadline, meeting deadlines is completely critical, right? On human-oriented systems, meeting deadlines is just the thing that we focus on a lot, okay? All right, next time we're gonna go through simple policies, we're gonna go through some scheduling abstractions and we will talk more about the stuff. See you on Wednesday.