Okay, it's 135 let's go ahead and get started.
Good morning everyone. I have to say I'm really surprised at how many of you are not coming to lecture because you all are leaving like 4% on, you know, I, of course I'm not going to lower your grade for not attending lecture, but it's an easy way to
get like Mark so I'm just kind of surprised. But anyway, we'll see we'll see how it all turns out today.
Today, I'm so midterm grading is proceeding down nicely I finally got that going. And so that should be done soon. And, and assignment, three is just about there I should have it, having to have it by tonight.
So I'm not be posted.
So today I am playing on tech talking to you. Yes, question.
It's just gotten without meeting up.
So, today I want to talk about tutorial seven and tutorial seven is really.
I haven't uploaded a two grades. I just forgot I yeah I was focusing on getting the midterm graded and have not done so there's these various bits of processing that I need to do.
And so, so yeah, so, yeah, I thought assignment to is graded but I just upload so my goal is to make sure you have all your grades in by.
So right now we're I.
Let's go to.
So we go here and we look at the dates here so
tutorial.
The next assignments do on the 21st.
So you should have it.
I think later today so you should have at least 10 days, you know today or tomorrow but she should at least 10 days to do the assignment, the assignment again is basically basically tutorials, a little bit of stuff about containers
assignment. um, well the thing it's all the big thing I want to mention was that the, the last day to withdraw is November 15. So my plan is to have all grades in basically have all grading caught up by November 15.
So if any of you want to, you know, what do that to decide whether to stay in the course I'm not so you'll have that information.
tutorial seven is not for assignment three, no tutorial 7078 and nine off for a for.
So.
So anyway, so that's some.
So that, you know, so that that's where we are right now, so let's go talk about
the tutorial so tutorial seven is all so we saw a little bit of EBPF in the, in the previous tutorial that you're just using as a tool here you're getting more into it and this is all part of us getting you really understanding what's going on with the
colonel. Much of the stuff here about how to get EDP, I get the stuff running. You shouldn't have to worry about this.
This is all this stuff is all actually DPF tracing just work in Australia CPF trace works in this today and lecture, but first I want to give you a little background, so.
Oh,
where's my image wrong there update that
young, there's no updated image for the semester.
There's just the image that is there. So, what's the name of the image.
So,
so. Yeah, so this is yeah so there was some issues in a previous run and that's from from last fall and I forgot I had put that text there. I will update that.
So,
40.
So, for tutorial seven, you really need to start, understand, Ed pf throughout fits in with stuff.
It the to hurl explains itself I want to talk about it in some more detail because it relates to the stuff we've been talking about regarding the colonel in user space.
So remember we have kernel space and user space.
So, your programs user spaces what you run whenever you know our process. It's mostly what you interact with.
So.
So this is again.
I find the past year students often have a real confusion about processes running as root and the colonel, a process running his route is still a process, and it has to live by all the restrictions that a process has to do it doesn't have a limited access
with the secret you know to this hardware. It's still the CPU still running in user mode. However, when a process running as root has.
When a process running his route makes a system call the colonel base goes like, Oh, you want to do that. Sure, I will do that. And it will can do all kinds of things on its behalf.
So I'm getting to is George you're exactly right.
So, kernel code is in two things that we've talked about primarily, there's the colonel image that's loaded, initially, that comes from slash boot that's loaded by the boot loader.
And then there are kernel modules that are loaded.
kernel modules you can really think of is like dire.
carnivores are really like dynamically link libraries, but for the colonel, it's code that is loaded into the kernel. So, when I go on to.
I can type a command ls mod.
This lists all the modules that have been loaded into this kernel.
And you notice that there's all kinds of ones you kind of go like, really. PS mouse.
So, soon to a PS mouse refers to.
So it's mouse code, but you know why it's PS.
Yep, PS to a, it was no not PlayStation.
This is the original IBM PC.
IBM tried to make the IBM PC after it got cloned more proprietary, and they introduce the IBM GPS.
And as part of that they came up with a new standard for attaching keyboards and mice to it and yeah and so that is, that's the standard that we still use for old style keyboards and mice.
Now of course we move to USB on most systems but a lot of PC still support that. So, there's code being loaded into the kernel for supporting that that like their DRM stands for, I think, direct reading matters like video and stuff there's human.
There's you there's all kinds of things. Some of these are for graphics. Some of these are for networking that some of these for this is the motherboard floppy drive is the floppy module being loaded.
Yeah, the biopsy, you fit in quantum PS to a song. That is very true.
What's the X or.
Oh, I'm not quite sure.
But apparently the butter Fs is a file system, that depends on that.
Yep. Yeah, so, yeah, I mean I don't know what that is but we could look at it, you know, I mean, there's the code and the kernel but it's used by the butter Fs module.
So.
got a little history there in the chat.
Oh, so it's only a small fraction of sale module loads that you know into any given Linux system at any given time there's a lot more code that's available, but.
But
you claim presents w windows.
So, it turns out you don't need if you want to do flaming cursor's, you don't actually do that in the colonel because the mouse cursor stuff. He's actually controlled by the display manager, which is a which is outside of the colonel.
So, Just, you know.
So
why is.
So, kernel modules can be dynamically linked or sonically late.
So, when you build code for Linux kernel, when you configure the latest kernel to build it for every driver and stuff, you can say, build it, either you say I don't want it, you can say, build it into the kernel image, or you can say build as a kernel
module on most Linux distributions, almost every driver, and lots of other functionality are built as kernel modules, so that one kernel image can be used to support many different piece of hardware and the different machines can just load the modules
they need for the hardware features that they want for that kernel.
And so, again, modules the dynamically linked version of it stack would like to just built into the image.
So, the reason. So, the question I have for you now is what happens if a module what happens if a piece of kernel code, whether dynamic was, like, what happens if it's buggy.
What happens if it's buggy. What's a sec fault equivalent for a kernel module, You will know.
So.
Yes.
So when we talk about a blue screen of death, you're talking about the equivalent of a Linux kernel panic, it's the same thing. It's the low level Colonel will just go and I can't continue anymore and stopping up.
So a colonel. Oops.
goes.
Yeah, well, so member, the colonel doesn't really different just like your process, if you if an error happens in in the C library versus the one of your, some of your regular code.
Those are the same thing. It's just that you only consider the C library of you better debug, then your code or any other external library that you might add in.
If, but errors that happen anywhere.
And they look the same and that's the same thing for the colonel. It's like if you've got a colonel loops.
It could be in any part of the kernel and in fact actually where you see the error, like the part that does the, oops, may not be the part that actually had the problem, and the part where the kernel freezes me may not be the actual part of the may not
be where the corruption started. As with all, you know, bugs, the bug doesn't miss a manifest at the place where the mistake happened. So, and it's just much more complicated because your entire system goes down, instead of just a simple thing.
Oh.
So the system we boots assessor the cross solved its own problem.
Kinda
so safe. So when we talk about a source.
We want to run in safe mode, it's just basically running to a configuration that should hopefully work.
It's very possible for a safe mode on some system to still mess up, it's all relative. there's no specific thing.
Ah, yeah. Yeah, It's definitely it's amazing that we can debug awesome.
Do kernels have a lot of that you can access when it crashes. Yes.
Up.
So he looking for a long current long, there should be a log of what the Colonel's doing
these questions are actually relevant so I'm happy to answer them because it's all kind of
Carson yeah you're.
Yeah.
So, if you want to look at what you're at that's actually a good thing to do, let's let's meet fine like same.
So I went, so this is the kind of log on my system, or log out log into the sea and as all these messages and it says you know the date you know my machine name which called kind of narrow.
The name is Colonel, Colonel same you know what's the logs are it's it's telling you all these things and, oh I've got all these audit things from snap.
Why, O was awesome.
Yeah.
I have to find out, this is, this is how this is because some security stuff was on call them app armor.
Oh hi can spend time talking about the sort of things. Anyway, but yes there is a long saying, all that sort of stuff.
Can you know if there's something that got corrupted by observing the logs. Definitely. If you look at the logs, yes here. Yeah, Syria, if, if you look at the logs and you see a colonel.
Oops. Something bad happened, but also other error messages like maybe so this is might be complaining so if you see, but of course you have to understand what is normal from the logs, just like any application.
Yeah.
Yeah, Well, it's.
Nobody understands everything that's happening in a given system at the level of the, of the colonel so you can go in and learn about parts of it but normally have to just sort of go what's happening.
Anyway, getting back to the point of why I'm mentioning all this.
So, the idea of EVPFR is really to say.
Wouldn't it be nice to be able to add coach the colonel safely.
Once you want to be able to do this, you know, you know and what would look like. So first off.
Okay.
So, so why do you want to add code the colonel the first place, you know, really the main reason people typically talk about wine do this is for introspection, you want to observe what's happening watch every process on the system, every memory allocation,
all network traffic. You can see everything.
So
injects a POC, yeah, it's going to modify the colonel and other uses, yeah yeah you can also do bad things.
But.
So what does it mean how could you add code to any system, and have and have it be added in a safe way.
This was so.
so it's not this is not version control and tested that's, that's not it. You have to have some more fundamental.
So.
So here are the two big things that you can do to
know it's not about. And that's not just good code. So good.
So, it's not that. So they're actually has to be some limits to what your code is, it can't just loop infinitely because I can consume arbitrary resources, and you can't just access memory arbitrarily, you have to make sure that all memory access is safe.
So, what basically EVPF has a little loader that when you try and load an idiot program into the kernel, it checks it for these things. And then, and it does some other checks too, but these are the big ones that it's not trying to access arbitrary memory
is not, it's not trying to unbounded loops. And if it does that it knows it's time is limited space it uses it limited and so the code is much safer.
Now
well.
when you write EVPF code. The hardest thing to do is actually getting the code to pass the verify or because you're trying to do perfectly it's like I want to do this I want to do that like now just a typical like a wild.
You can't do a while loop in EBPF code, because it will consider to be an unbounded loop it'll just go like, Nah, it'll freak out and you can't do all kinds of standard idioms for NC for accessing variables, because the verify can't be sure you're not
going to access some memory you know arbitrary memory. So, yeah,
there's all kinds of OEBPF code has to run through it.
Can you bypass the very fire.
So there's basically two ways you can low current code is a kernel dynamic easy blood is modules or does ATP if you do it as a module there's basically no checks, but maybe a digital signature and EBPF there's lots of checks.
In fact, EVPF.
So another way to do safety is you can't actually it's not actually machine code that's being loaded into the kernel. It's a special byte code for the VPN virtual machine there's a whole specification of it.
You mean, and that code is designed to make it easy to verify as lots of extra information that isn't in typical machine code that allows the verify or to see whether this is fine and then that after it passes the verified.
But then is turned into machine code, and then is linked into the kernel, but because it's gone through the step, you can have all these, you know, guarantees Now you might say.
Yeah. So, As you might expect, only the root user can load kernel modules into the kernel.
So, that's a way for the user to kind of bypass the colonel user space, you know, sort of thing because you're the root user is running in user space, but the root user could make a file, make it kernel module and then loaded into the kernel and then
now some of the code it was doing is now running a kernel space and do whatever he wants the system so that's how you can cross the boundary.
EVPF on the other hand, again, is also restricted to running, you know, as route, because there have been proposals to try to make
a VPN code
usable by a non privileged users, but that's been very problematic.
So what language do we write a kernel code in okay so.
there's a bit of work on adding Russ support for running your kernel code rust.
That's actually moving along there said some integration, but mostly the kernels written in C.
A few portions are written in the assembly, but most of it's written in things.
It has it so it's.
There's an EP pf virtual machine the sense of is an abstract machine that the VP of code is written to but once you can, but once it gets translated into machine code and then get the LinkedIn and they can.
It's running as binary.
But technically once it's all in the computer is just the binary. Well, it's not so much about binary it's more about what language it's
the boot loader and the colonel, and most compiled programs are in machine code for the processor you're on. So if you're on an arm machine like on a smartphone, it's an arm you know machine code on your desktop, laptop it's x86 64 machine code.
So yeah, that's um.
So it all depends on you know the process there EVPF byte code is processor, independent, it's the same byte code that will run on ARM x86 MIPS pa risk, you know your name the CPU, it would it would be the same EDP f code, but then it will be translated
into the machine code of the process or you're on and remember we talked about assembly language assembly language is just a human representation of machine code so there's different flavors of assembly code for different processors, and
will be accurate to say the boot loader is being the first punch card into the operating system. I'm.
This kind of the only troll with a punch card thing is, I guess so, yeah, it's kind of equivalent. Yeah, it's
so is EVPF similar to Java, um,
it's a. The.
It's similar to it has some similarities to Java byte codes.
Yes, the Java byte codes right of the JVM Yeah, it has some similarity to that in the sense of it but it's a,
it's much more restricted.
And it's, uh, yeah, it's much more strict so.
Yeah, it's much more strict so
I can talk about Russ later.
I'll just say rust allows for safe, low level programming.
No, I'll say that but yeah there's a lot to be said about Ross it's very cool thing.
But so what does EVPF stand for as for the enhanced Berkeley packet filter.
So evils enhanced version of BPF.
So you want to tell me what what I talked about packet filtering up.
What is Why talk packet filtering Does anyone know what I'm referring to.
So.
So packets we know we're talking network pockets.
So packets are just you know it's network traffic is coming into the kernel Bitcoin the system, it's leaving the system. And it may go to one or more processes, depending upon the kind of network traffic it is most of the time, network traffic will go
to a specific process with my little process listening in on it so there's packets are being processed.
So, that puts it.
So if you want to do something like a network firewall, if you want to observe traffic do that, I'm just having the functionality you need for a network firewall but there's lots of other things you can do.
It's a network firewall is definitely a security mechanism, but there's, you know, lots of functionality can be done with.
If you can manipulate the pockets, but.
So that's this is the basic idea of EBPF was a BPF was the Colonel's do all this network traffic and things during this manipulation. If network traffic comes in.
If you wanted to have it be manipulated by both individually in any way, you'd have to dump it to user space so a process could interact with it, and then it would send it back to the colonel and we don't say oh yeah of course that's what we do everything.
But if it's just network traffic and sometimes network traffic, you know you have some serious time constraints and processing this data, especially to say if it's acting as a you know, a few packet capturing racking the firewall and really, you're not
doing stuff network traffic you're just trying to pass it on. So, saying it to user space and sending it back to kernel space is a huge performance hit, because of Trent switching the CPU from supervisor mode to user mode and back.
It's not cheap. And in fact, one of the big ways you optimize programs and a lot of context is by minimizing the number of these called context switches which in.
to minimize this for networking applications if we know if I just want to Prof. I'm going to give the. I'm going to get some pockets, do something with them and then send it back to the colonel, why bother going back to us.
I could just put my code into the kernel and can do it all in kernel space.
And let's avoid that transition.
And if it turns out I have to do very simple things like sy put in some simple rules of saying, Well, if it's coming from here, then just drop it if it's if it's going from here than reactive me.
You can have.
You do very simple things there specify the rules of what you want, maybe it might be as simple as saying, I want. I'm going to have access to all network traffic but I only want traffic going to this particular host.
So you get to go rule in there, and then your process and the rule would then check each packet and say oh does that meet that criteria Yes No, that does then pass it on to us a space of not let it go, makes for a much more efficient architectures.
So.
So, with EBPF technology.
You can mess with every process on the system and have for and Colonel Dave structures.
Yeah, the even see everything on the system you can see what carnal functional again call, see what you say stuff is getting called.
It's just crazy pants what you can do. It's.
And that's what we're, that's what you're playing with tutorial seven.
So if you look at the scripts. What is it asking you to do.
It's running things like open.
What is open Snoop do it shows you every open every file opened on the system.
You know what happened you know when things are opened, every time you run a program, it opens, lots of files in order to see, you know, load all the libraries, so you can watch that happen with open snip with the exact Snoop you're seeing every exactly
he on the system.
Kill Snoop you're watching all the kill signals.
You know, there's like you know every time someone you know every time one process sends a signal to another, you know, kill us is a system called it used to set it for one process send a signal to another, you can observe all that.
Here you can get statistics on every system call on the system.
What's written exclusively by netflix people not know this all this stuff is much bigger than Netflix, although Netflix certainly has been a pioneer and DPF.
Yeah, it's literally Snoop Yeah, no, it's literally snooping yes bash really is crazy, every process running bash.
You can see anything typed into it so this is best, you want to log in multiple times into your VM, you start typing commands in one window.
And another one, you'll see what's being output.
So that's why this stuff is crazy powerful for doing things now.
If we look at the.
So this is so there's two there's a couple of technology
required.
So, this.
So,
don't talk about Well actually we get we can talk about that so the reason why there's a question here why badly read line doesn't pick up the first one, it's, It's basically because the system calls already happening.
It's already you know, and bash realize just you know instrument at the beginning of, when the reach system calls being made, the reeds calls already been made was raining return value it's too late to intercept is always Kaushik Is that what you're thinking
of.
Yeah. Is that what is that what you're thinking of or the thing is like different.
Yeah, okay. Okay, good. So, so there's, there's two technologies, one is BCC, which is Python scripts that embed C code and get trying to be a byte codes, that's so if you look at the.
This, which are ta who say for added to this. This is a Python program. And in this program.
It's actually, you know, It's actually including.
Where's the. Oh yeah, VP of trace print K.
Yeah, so it's doing. So this is all this is doing, actually, there's a little EBPF here that's being called we're actually seeing this encounter here.
But maybe better look the other version of it so this is mixing Python and EBPF code underneath there's some C code has been compiled.
But then there's also BPF trends.
So BP of trace has different syntax.
So, for example, and that's what the doc, so there's versions on here. Let's go to my show.
You guys are.
so if you look in here, there's BCC user BCC, you go to Tools.
And here's all there and if you look at
your look here this is bash read line.
This is battery line, it's a Python script.
And, yeah, So this is, you know, US visa BPM VPN embedded see so this is
right this is made from by Netflix.
And then, but there's also a
logo except VPN trace.
So, here, there's the DOP bt ones.
So compare this, this is BPF trace. This is the code needed to do what you know battery line does this much.
But compact contrast this with this is bash read line.
But look at all this stuff. And this is the code for it's not that much longer book from import purser, you know stuff like
yeah all this. Yeah, there it goes. All this code is required, versus here just this.
So, just to be aware there's so you're seeing both of these in part A you're playing with BCC in Part A and Part B you're playing with BPF trace. And so by seeing those two things you can see like there's me, you can fill with the BPM trace code much
more easily than the BCC code.
But again, this. The purpose of this tutorial is just to give you an idea of mean I not really caring about you,
creating these programs that's we're just doing one tutorial on this we're not doing self development, but what I do want you to know is that that is possible to run these kind of tools that these things can do.
Amazingly, you know, powerful things with sometimes with very little code, and that by putting code. How can I get a view of every process on the system.
The only real way to get a view of every process on the system is to talk to the colonel. If you aren't talking to the colonel, you aren't seeing everything that's going on in the system.
So, and you know what's the way you could do that you could write a kernel module and put it into the kernel and try doing that but then that's mean this very possibly might just make a mistake and crash it but if you're doing it with these kind of tools.
You can do it very safely or very unlikely to crash anything, and it can be much less code is much easier to do this all this introspection.
So that's what I really want you to stand for what is possible to do, but just the most of this tutorial is just running the simple scripts and just observing it, but.
Your goal should be to like makes me do X, but more like what am I seeing what is this stuff producing. Why can I see what it is, how is this different from just writing a regular program and see you running GCC on a compiling and running.
What's different about what I'm doing here.
Yeah. Okay, good. Yeah, so this is a tutorial sounds like so you see the colonel, you're interacting with a crow and no specific way now, and then after this, we're going to directly start looking at kernel modules to do even lower level stuff, and say
look, we can add functionality the kernel we can change our operates, we give it new interfaces and ensure a lot of the stuff we do in a separate module could be done.
A lot of it with GDPR.
Um, but again it's just the purpose is not for you just go in code stuff is for you to build up your mental model, so you understand what's happening.
So I think that's all I want to say about tutorial seven, because really the point of true to ourselves more see the conceptual stuff and I can be a time next week guys walking through some things.
So I thought we'd let me demonstrate some stuff let's do that.
I've already discussed solutions for assignment to I've got that I've got the marks there is no post them so assignment to marks all I'm going to worry about posting the ones I put up assignment three.
But you should have all your marks by Tuesday
up. I think I want to I've got a couple of minutes here I'm kind of at 20 minutes.
Signal zero or just signal.
I'm not sure what signals zero is.
Oh, right. I actually do know what signals your ears that's to
where we were to see signals zero.
think that's a check for things like tutorials seven.
Oh, right. you see it in the
tutorial seven.
Which question talks about that.
Okay, we're.
Alright.
I'll talk about.
I'll walk through this on Tuesday I don't want to talk about this just yet.
Hey, after the first question of that part.
Yeah, what is this zero single use for part one of that.
Kill caught some calls happening when you do nothing. Yeah, when I ran it. Nothing showed up for me.
You saw nothing at all.
Not me like I saw like the the initial output like printing the table columns, but nothing appeared.
Did you try say a kill signal and did you get some output. Yeah, and actually sent kill signals that got stuff, but when I did nothing, nothing showed up.
If you have.
You guys have Xg go running that normally should be generating some background traffic.
I don't use sex to go.
Okay, I'll lead you on my system here let's do I have BPM race.
No, I do not was when they started to take a look and see what's happening there because I'm thinking about
XT go flood. Yeah, it was pretty bad so let's you know.
Let's kill Snoop.
your lawn chair.
There we go.
But as my say
Just remembering what my IP addresses.
Okay.
So that shows you all the rules, and we live in.
yo.
Yeah. I think the older version of the VM generate a lot had a lot of spurious signals going on. There's a whole bunch of stuff going on here. Now it's just happening when you.
So you can send kill signals, but it's not doing anything by default, but interesting thing when you do login it does show some stuff.
I didn't send commands it did work but it just ran the program did nothing less than that but you see what I logged in from another way that I didn't get that.
Yeah. Okay, good.
I change.
I'm not sure why that
turns out the way you do kills.
So if so, So this is what if P equals zero.
So when you send a signal to process ID zero, so that every process and the process green.
If SIG is zero, then no signal is sent. But the existence of permission checks are still performance and you check the existence of a prophesied in the cars from going into signal so if you don't want to actually kill something but you want to see if
allowed to kill something, you send it with you send a signal zero. And that's a general thing to note if you're looking for things like there's a command line version of it does this this is not documented in the kill man page and just say man kill.
But if you say man to kill you get this because of this, because I do.
So this is kill one, this is the one is the commands to is the C library.
And so this is where the functions and this actually will give you a bit more information.
Yeah, that's this man pages and tell you much at all. This one tells you much more intelligent how these, you know, these things.
So.
So another question, because I could start talking about.
There's a question. So, there was a question about tutorial six Why does one deadlock low, but why does it deadlock and the other one not deadlock.
So let me just show you that code.
So we're talking about.
So the question is, is, why,
why does this code
fail
me what really happens is is the consumer and producer, both end up in a state where they're both waiting on each other.
And why exactly that happens.
As far as I can tell what's happening is is this wait happens and then it's never woken up. So, best that I can think of is that there's a timing issue between the sending of the message and the message gets lost.
Basically the moment this way, like this way to happens.
I'm just this wait happens just after the message is sent from the producer.
It doesn't happen that often, but it happens often enough, so like this 3000 pc rendezvous works in the sense of it will fill up the Q will signal go both single back and forth.
But at some point something will happen, which caused them not to interact and I'm not quite sure exactly what happens. And if any of you try using a debugger and figure it out.
I would love to know why because I don't quite know why this code fails, logically it should work.
But for some, but that assumes that the messaging between the producer and consumer is perfectly reliable.
And what this empirically tells me is that it's not entirely reliable this condition Wait, doesn't actually always happen.
Right.
So concurrency yeah deadline. Yeah.
Jason yeah that's that's a good thing there you know wait for to flush out, that's a classic thing but this.
This is more subtle, because this program mostly works.
It runs for a while, you can actually run to like 100,000 things that will often work.
But, but it doesn't always work and that's why you have to have the timeouts so that it checks again and then it starts.
So, when you go to a show.
Welcome to the terminal here and cause.
Yeah.
Professor. Yep.
Regarding the rendezvous.
Every time when producer or consumer either consume, or they write to the show memory, they send a signal, right.
So, this to me right now, it seems to me that the actual weight doesn't monitor a signal, because even if we miss the first signal issue still get the second signal so, like, you shouldn't just hang there because it going around line and I'll put it.
The.
It runs for up to the point where the current consumers waiting, and I stopped there. So now the question then is, it seems to me that it's not. If he missed the first signal is so studious still should get the second, third and so on so forth.
So it's not necessarily is not getting any signal at all, my says wait.
Yeah. That part is me. Because, so let's all let's run this year.
This is running.
So now, now we've gotten the deadlock. And notice the deadlock happened after 293,000 words, which is much larger than our buffer.
So messaging happened between the two. You know, you know, constantly now we can say is
if you run top here, you can see that.
Actually they're both running full out.
Oh my other ones still running.
Okay.
Yeah, that was still running. But these guys are not so if I do
you see the, the timeout log got rather large.
But the.
I was using 255% of the CPU, because
I have on this machine virtually.
It thinks it has a course.
Right. Yeah.
Yeah, a course where it really is a four core machine which is hyper threaded. So you can have but you can have up to 800 800% CPU usage.
So zoom is using more.
So well so yeah so so this right now.
So these.
Yes, they are. you know, they are using.
They are doing nothing right now.
They are just sleeping.
They are waiting on something. So now, I could, I should be able to tap US GDP.
Okay, what do I have to supply.
And so we just
know it will tell me I can't do this. So I'm another window I am just I'm just
changing this Echo Fox this.
So, the pipe.
Like, does it mean like look fit designated time runs out stop bleeding or does it mean something else.
So I just say repeat that. So, like in the timeout version, like, it's like a designated time being set for the late.
Exactly. So the idea is that if it hasn't been reached at the timeout happens and so then it tries again. And it basically it instead of just sleeping, it checks the data structure to see if it will continue work.
And if it's still not then it waits more is hyper threading a topic in this course, not really, all hyper threading is it's a way of a CPU running two threads at once.
It's kind of basically it's a cheap form of multi core.
It's, it's a complicated topic because I have to explain CPU architecture.
That is definitely beyond the two topics course but just high level Think of it as modern CPUs can do a lot of things in parallel, and in fact there's so much hardware that most of its not getting used even on one core.
When you run one program and so if you can run two programs at the same time on one core, you can you know they're going to potentially interfere with each other, but depending upon them, they might they might actually be able to run in parallel and use
different parts of the chip in order to proceed. But so um.
So what's happening now is, it is running.
Please wait comment if you're awake cancel out p3 con Wait, it's it's waiting on getting next word. So it's, it's doing wait for producer.
Okay, and then we can say. So what was that that was attach
was the process.
I'll check another window HOME
SEARCH till 56.
Yeah, okay.
Okay can catch
a bus, I'll stop the lecture so you can continue but watching I'll stop recording here, well I'll keep recording but feel free to go right now. I'm just going to show this investigation.
For those who want to watch the lecture here.
And so, the one this one is waiting in.
Where is it.
Yeah. So this is the producer keyword, wait for consumer.
And this one's wait for producer, so they are that definition of deadlocks producer is the consumer is waiting for the producer, the producers waiting on the consumer, so it's kinda.
So, it's kind.I'm not quite sure what that program does it. I mean, teams like quality communication. Why exactly happens, I don't quite know.Yes.But thank you everyone.And I'll see you tuesday were no flesh out lots of great to see that.