Okay. Hello, in this code walk through what I'm going to show you is the fundamental difference between SMP symmetric multiprocessing and AMP, asymmetric multiprocessing. And hard real time systems and some soft real time systems to we want to use amp rather than SMP. Linux comes pre-configured for SMP. So remember from the terminology SMP does load balancing and it determines what core a thread is assigned to, when I say it I mean Linux. What we want to do is have our application our system, in terms of what core runs what services and have them pinned to that core for AMP. So, what we want to do here is we first want to see what SMP looks like. So there's a starter example code called increment decrement thread, I've slightly modified it, so let's take a look at that. So I took the p thread, that's c code and you'll see I increase the count to 1 million so it runs for a long time. That's all I've really done compared to the starter code you've already looked at. And if I run it now, let me go ahead and run it. You can see it runs a lot longer than it did probably when you ran it. And I'm going to go now look at htop, over on my Raspberry Pi in a separate window and you can see Linux is working hard to try to keep all four cores busy, core one, two, three and four. You can see it doesn't do a perfect job of it, it moves around. But all four cores have some CPU loading on them. Right? And in fact, we can see three instances of P thread. And in fact maybe to make this even more interesting, we could create more incrementer decrementer threads, and then that would load this even more. We've just got the main thread and the incrementer and the decrementer threads, so we only have three threads. So the loading on the fourth core is the OS doing things on our behalf as well. So we'll let this run here just take a look at it and one of the nice tools that you should learn to use on your Raspberry Pi is htop, htop is fantastic. It's a real basic tool to see who's using your CPU. And you can see it by core. You can see memory usage as well and we'll use htop throughout the real time series, but it's useful in this course as well. Okay, so I'm going to go ahead, it's complete, and we'll see that htop settles down here, right, so the loading goes back to just kind of normal acquiescent system loading a little bit of load on core zero which is shown as one here by the way. So zero is one, one is two, three, so on so forth, right? [LAUGH] So, we just see the kind of background processing of the system, the kernel Core 0 which is shown as 1 here. And now I'm going to run something different. I'm going to go ahead and run the am made no changes here. I'm going to go ahead and run the simple thread affinity starter code example, which you'll find quite useful when you have to create threads that have affinity for AMP which is required for the final project and required really for anytime you want to have valid rate monotonic analysis with multiple services, multiplexing or sharing one core. So let me run it here. I made a mistake there, that's kind of good that I did. What I have to do is I have to do sudo and run it because it's going to actually run with FIFO priority. You can see that previously I had done that and I just forgot to preface it with sudo. So I'm actually glad I did that. Don't forget, [LAUGH] it'll fail as it did there and just say scared other operation not permitted. Transition the policy over to scan FIFO real time so now it should work. There it goes. A lot of a lot of students forget that sometimes professors too. And now we look at the htop and we've got saturation of number four, core three, fully saturated. All of our workload is on NET Core. This makes rate monotonic analysis much simpler. There are ways to do RMA on SMP but that's more advanced. It's more of a research topic, there you can see completed and we can do dynamic priority scheduling on AMP or SNP as well. So we basically have four ways to schedule soft and hard realtime systems AMP and SMP. Dynamic priority and fixed priority and we can have any combination of those two things that we have four total ways, but the approach we want to focus on in this course is AMP with fixed priority preemptive run to completion using sched FIFO. Thank you very much.