Multi Programming - Computerphile

  Рет қаралды 79,461

Computerphile

Computerphile

Күн бұрын

Multitasking is a hoax - clever techniques mean that your CPU is shuffling between lots of tasks, but doing them one at a time. Dr Steve Bagley regenerates his clones to explain...
/ computerphile
/ computer_phile
This video was filmed and edited by Sean Riley.
Computer Science at the University of Nottingham: bit.ly/nottscomputer
Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

Пікірлер: 235
@kwanarchive
@kwanarchive 4 жыл бұрын
Computerphile single handedly keeping the dot matrix paper industry alive.
@pukkandan
@pukkandan 4 жыл бұрын
Why you eating my processes? No wonder my pc keeps crashing
@kattenelvis1778
@kattenelvis1778 4 жыл бұрын
Wait until he starts accepting cookies
@ADEzor
@ADEzor 4 жыл бұрын
@@kattenelvis1778 great. Now my coffee is all over the place. 😂
@delusionnnnn
@delusionnnnn 4 жыл бұрын
Because they're delicious. The black one obviously tastes like ... choosing my words carefully here ... licorice. It didn't stand a chance. Too delicious.
@jamesgrimwood1285
@jamesgrimwood1285 4 жыл бұрын
One of the most interesting parts of my Computer Science degree was learning about operating systems by stepping through the Minix source. Although things are more complex now with multi-core CPUs because now more than one thing (or more than one bit of the same thing) can run at the same time.
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
@@existenceisillusion6528 and now it powers the Intel Management Engine!
@Nayus
@Nayus 4 жыл бұрын
The concept of showing it with the different Dr. Bagley clones is brilliant! and not easy to do!
@totlyepic
@totlyepic 4 жыл бұрын
You have no idea how happy you've made me by finally increasing the number of actual computer science videos on this channel. You guys are doing a great job.
@konstantinrebrov675
@konstantinrebrov675 4 жыл бұрын
An example of Multi Programming: I'm watching this video while I wait for my code to compile.
@JDines
@JDines 4 жыл бұрын
No. That's Multitasking. Multiprogramming would be if you were multitasking watching FOX News and a commercial at the same time.
@kokki1452
@kokki1452 4 жыл бұрын
@@JDines lol
@mannyknowles
@mannyknowles 4 жыл бұрын
Exquisitely presented. That KZbin plaque in the background is well-deserved. Computerphile remains one of my favorite channels.
@jmalmsten
@jmalmsten 4 жыл бұрын
"... unless the process is just very boring and just kills itself..." That's a bit... harsh? (Yeah, I know, it's perfectly usual programming lingo. :) )
@beachboardfan9544
@beachboardfan9544 4 жыл бұрын
Gettin pretty fancy with the editing!
@theharbingerofconflation
@theharbingerofconflation 4 жыл бұрын
Killing them.. I remember having a conversation about host process management from an OS perspective in a café once. Told a guy semi-loudly "Remember that we also need to kill all the children of the host" (referring to child processes) "Before we kill the host." Coffee lady came by asking whether she has to call the cops on us or whats going on.
@CharlesNiswander
@CharlesNiswander 4 жыл бұрын
That's hilarious!
@georhodiumgeo9827
@georhodiumgeo9827 4 жыл бұрын
My mind is blown. I just can’t believe they made that exact same shirt in two colors.
@RyanFernandezz
@RyanFernandezz 4 жыл бұрын
This was a really fun idea for the editing of the video Sean, great job!
@TheAnkMan
@TheAnkMan 4 жыл бұрын
Steve is one of my favourite profs and Computerphile. Also loving the array of vintage computers in the background. Hmm, talking about that: he should do an episode only about them. Show every of them and give a brief history and hardware specs.
@ujjal147
@ujjal147 4 жыл бұрын
Looking forward to both future videos!
@MrJezster
@MrJezster Жыл бұрын
I have not seen this type of printer paper since 1993 when we used to load it into Honeywell DPS7 mainframe chain printers. Love this channel so much, really interesting.
@lohphat
@lohphat 4 жыл бұрын
So a 12 core CPU gets you to the diabeetus faster then. Got it.
@majcherek128
@majcherek128 4 жыл бұрын
Concurrency is not parallelism
@dipi71
@dipi71 4 жыл бұрын
Indeed. »Read the 1978 CSP paper -- it’s deep and wise« (Rob Pike about C.A.R. Hoare’s seminal paper »Communicating Sequential Processes«).
@kortaffel
@kortaffel 4 жыл бұрын
You deserve an oscar for this!
@Roxor128
@Roxor128 4 жыл бұрын
I remember hearing about an incident involving MacOS's cooperative multitasking. Every now and then a network full of macs would stall, then get flooded with packets. It was eventually narrowed down to a specific machine and when the admin went and investigated, nothing seemed to be out of the ordinary. After a few occurrences of this, the admin sat down and watched the user at work. Sometimes when working with the mouse (might have been drawing), he'd hold the mouse button down for much, much longer than was normal, and with the input handler being tied up on the long mouse press would result in nothing else in the computer getting to run, including the network stack. As a result, no packets were passed on from the machine in question and the buffer would just fill up, resulting in a flood when the user released the button and the network stack got some processing time again. A gentle word with the user not to hold the mouse button down so long fixed the problem. Don't know if it's true or if I remembered all the details correctly. I didn't have any luck tracking down the original before making this post.
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
Reminds me of the however-many-mile email problem story.
@Roxor128
@Roxor128 4 жыл бұрын
@@kaitlyn__L Ah, the 500-mile email. I remember that one. Caused by mail software having a default timeout of only a few milliseconds, wasn't it?
@spikeevans1488
@spikeevans1488 4 жыл бұрын
Very good video. I'd like to suggest looking at I/O scheduling. Both windows and linux can become very unresponsive if doing heavy I/O. I've seen cases, even on a very powerful PC, where responding to a mouse click can take many seconds during heavy I/O (disk backup, file downloads etc). Perhaps look at the various scheduling algorithms and their pros and cons.
@OverKillPlusOne
@OverKillPlusOne 4 жыл бұрын
Spike Evans Linux default I/o scheduler is utter pile of trash. I don’t know what use cases it works well for but anything interactive is nearly impossible under high I/o load unless you change the I/o scheduler. Windows the usual issue is swapping (not enough physical RAM)
@spikeevans1488
@spikeevans1488 4 жыл бұрын
@@OverKillPlusOne I think that the mouse and keyboard should have priority over all else. I don't believe windows is a RAM issue. I have and 8 core 16 thread CPU with 32 gig of ddr4 ram. I think, I don't know for sure, there is a single I/O queue that's the problem. In any case, it's my computer and when I click the mouse or type it should listen to me.
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
@@spikeevans1488 Yeah, this is a very big problem. Even when there's not a huge lockup, modern OSes have measurably higher delay on typing or mousing than in the 90s, and the delay was even lower in the 80s.
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
@@OverKillPlusOne the use cases it work well for is basically just as a headless server. So that probably explains why it's so much more accepted in the server industry than the home computer industry still. It would be nice if Linux could adapt its priorities based on whether you're using a GUI or not. Like if your home rig is also being a NAS for your laptop, you might want it to prioritise the file transfer if the screen has gone to sleep. If you're watching stuff on your laptop you're not likely using the desktop. And if you're on the desktop, why would you stream stuff to your laptop? So a file transfer could go 10% slower and you wouldn't mind because you're using the desktop at that time.
@OverKillPlusOne
@OverKillPlusOne 4 жыл бұрын
@@kaitlyn__L Dayjob involves running thousands of Linux based servers. On anything I/O taxed we have to change the default scheduler else things like databases get crippled because of I/O staying in the queue for multiple seconds when you reach I/O limits (like on the older fleet of hard drive based database servers). The default deadline scheduler has two queues, a read and a write, and will starve the write queue blocking the world up under heavy I/O. Linux has completely separate handling for other I/O events.
@maxtaylor3531
@maxtaylor3531 4 жыл бұрын
You guy’s are missing out. When Bagley gave us this lecture we also got to eat the jelly babies.
@ArumesYT
@ArumesYT 4 жыл бұрын
Yeah, but you only had one Bagley.
@maxtaylor3531
@maxtaylor3531 4 жыл бұрын
ArumesYT we had all the Bagley. He exists in a 4 dimensional state across all of space and time and we only see a three dimensional projection of him. His true wisdom is beyond our comprehension. Ancient writings suggest he derives his power from Diet Coke.
@SupaKoopaTroopa64
@SupaKoopaTroopa64 4 жыл бұрын
This is the most clear explanation I've ever herd for this topic!
@hirakmondal6174
@hirakmondal6174 4 жыл бұрын
A new concept from computerphile.. *_I LOVED IT_*
@yoloswaggins2161
@yoloswaggins2161 4 жыл бұрын
Example of multi-programming: while I'm watching this my evil clones are taking over the world.
@TimothyKist
@TimothyKist 4 жыл бұрын
Exceptional video! Explains it very well using some cool techniques :)
@colin-campbell
@colin-campbell 4 жыл бұрын
It’s like Boris Johnson had an illegitimate child.
@Kaaputenen
@Kaaputenen 4 жыл бұрын
Bit of a weird trippy out-of-body experience with Prof. Bagley. Good video, cheers.
@sstshivam
@sstshivam 4 жыл бұрын
Thanks for the video! Looking forward to the scheduling and context switching videos. :)
@jesper2455
@jesper2455 4 жыл бұрын
I love this channel so much. Thanks for another great video.
@Masterbutler123
@Masterbutler123 4 жыл бұрын
Loving the production value haha
@thodorisevangelakos
@thodorisevangelakos Жыл бұрын
Actually incredible explanation, thank you!
@SteveGouldinSpain
@SteveGouldinSpain 4 жыл бұрын
So penny dropped moment.. with 'process explorer' in Windows you can change the priorty of a program. So presumably then that is the pre-emptive part of the OS figuring out how much time to allocate to each one, no? Now I'm going to have to go buy jellies!
@bersl2
@bersl2 4 жыл бұрын
Almost. The priority value Windows lets you assign is used as one input by the scheduler to decide when and how long a program runs, but that algorithm has a lot of other internal parameters that users can't (and almost certainly wouldn't want to) directly touch.
@prontosolutions4370
@prontosolutions4370 4 жыл бұрын
you needed this vid to figure that out?
@SteveGouldinSpain
@SteveGouldinSpain 4 жыл бұрын
@@prontosolutions4370 sorry dude, I'm a Unix guy just trying to figure this stuff out. Didin't realise I was going to be called out by people like you who clearly know everything!
@bytefu
@bytefu 4 жыл бұрын
@@prontosolutions4370 Somebody at some point needs something to figure something out. That's how it works.
@sundhaug92
@sundhaug92 4 жыл бұрын
@@SteveGouldinSpain Kinda similar to nice (and ionice)
@frosty3579
@frosty3579 4 жыл бұрын
Nice editing work!
@nO_d3N1AL
@nO_d3N1AL 4 жыл бұрын
Nice editing
@server642
@server642 4 жыл бұрын
This is such a cool way to visualize multitasking, both in the way the video was done at first and also with the diagram and candies! I loved it! I think I’ll show this to one of my instructors at my college and see if he’ll use it as a demonstration video for one of his classes. On a side note, the instructor I had for that class, before he retired, demonstrated multitasking by having students at the front of the class as processes and he would act as the OS and would tell the students to switch places as per the control-passing and timer-interrupt methods.
@DaveWhoa
@DaveWhoa 4 жыл бұрын
but you can't eat humans
@server642
@server642 4 жыл бұрын
Dave S Exactly! That’s why this is superior!
@johncampbell4389
@johncampbell4389 4 жыл бұрын
Handling interrupts are important because some will manage the context switching. A “hard” real-time system, where EVERY interrupt runs the scHeduler which likely forces a context switch... which means there are fewer CPU cycles available to crunch numbers.
@johncampbell4389
@johncampbell4389 4 жыл бұрын
On a non-real-time system, most interrupts get serviced and then the Control is passed back to the previously running process. In a real-time system, EACH INTERRUPT MAY CHANGE WHICH PROCESS GET CONTROL NEXT, so, after the interrupt is processed, the scHeduler is run to determine which process needs to cope with the most recent interrupt. The scHeduler takes extra time over and above the usual context switch. The higher the interrupt rates, the more frequently the scheduler is run, taking up cycles “regular” processes may be burning. I have run across people who think a process is so important it needs to be run during an interrupt... and, so, the system had problems. Some folks have no idea how priorities need to be set. In a usual (non real-time) scheduler, priority will float up and down based upon whether a process uses it’s time slice or not. If the whole slice is used, the process’ priority will drop,, giving it a longer time slice next time. Likewise, if it does some kind of I/O syscall, the priority will be bumped up and the time sslice (quantum) will be shortened. I/O bound processes float “up” in priority and compute bound processes float down. This implements a form of “fairness”. In a real-time system, priorities are set and do not change and you need to plan out ahead of time which processes get what kind of priority. (Don’t ask, this is a long and sordid story where I had a lot of resistance from the “key” programmer as I tried to get a FORTH-coded application into a Unix (well, LynxOS) system; I was the considered as the “young punk” at the time and everything I knew about OS internals was “just dogma”.)
@patrickgoetz
@patrickgoetz 2 жыл бұрын
Again, brilliant!!
@philipmrch8326
@philipmrch8326 4 жыл бұрын
Wow what a great video! Looking forward to videos about the other topics he mentioned.
@airjuri
@airjuri 4 жыл бұрын
pre-emptive multitasking... Looks like Amiga and its operating system was 10 years ahead of everything else back in 1985.
@WIImotionmasher
@WIImotionmasher 4 жыл бұрын
Giving me flashbacks to OS class
@Arnaz87
@Arnaz87 4 жыл бұрын
This video is nice, I'm usually not super exited about this professor's videos because I'm not into hardware stuff (os stuff is interesting though), but this one is really creative and original and interesting.
@user-le1zr2dp1k
@user-le1zr2dp1k 4 жыл бұрын
Steve, the ultimate process termiantor.
@dunda563
@dunda563 4 жыл бұрын
What a very comprehensive video, and an explanation for how the OS can escape even infinite loops! I've been wondering how that is possible since forever.
@TheMixedupstuff
@TheMixedupstuff 4 жыл бұрын
Yep. Most proccesors have a programmable timer that fires interrupts for exactly this purpose.
@olik136
@olik136 4 жыл бұрын
What I have learned is that I need an external interrupt to exit the infinite loop of looking at my phone- open the same useless apps- decide it is a waste of time- open youtube on my pc- start watching something- decide it is a waste of time- take my phone.........
@w0ttheh3ll
@w0ttheh3ll 4 жыл бұрын
awesome video, needs more views
@leanvlogs
@leanvlogs 4 жыл бұрын
Thanks for the english CCs
@bbq1423
@bbq1423 4 жыл бұрын
Have been wondering about this for eons.
@Furiends
@Furiends 4 жыл бұрын
"A modern operating system like UNIX" >.>
@StankyPickle1
@StankyPickle1 4 жыл бұрын
Thank you for this video! I think it very clearly explains the key concepts. With regard to the preemptive multiprocessing, how is the external interrupt handled? Is it done on a hardware or software level? Also, how is the external interrupt frequency chosen? Can it be adjusted? If a process encounters a regular interrupt, does it override the external interrupt? Sorry, I have lots of questions. Maybe a better question: where should I go to learn more details about this topic?
@schifoso
@schifoso 4 жыл бұрын
When the interrupt is received by the processor, it saves the state of the current process and jumps to the code that's been assigned to handle the interrupt.
@scotts9202
@scotts9202 3 жыл бұрын
great stuff, thanks
@TheAnkMan
@TheAnkMan 4 жыл бұрын
Dr Steve Bagley I still propose a new episode (episodes) you would give some information of the array of vintage computers showing up in your videos behind your back. Please explain what they are, in which year they were introduced into the marked of the 1980s and what impact they had back in the time.
@CoolJosh3k
@CoolJosh3k 4 жыл бұрын
Will there be a video on hyperthreading?
@polares8187
@polares8187 4 жыл бұрын
I love this way too much
@jmasterX
@jmasterX 4 жыл бұрын
Love it!
@thisisthefoxe
@thisisthefoxe 4 жыл бұрын
I've learned more in those 12 min. than in 3 months of Uni.. thx!
@igoralmeida9136
@igoralmeida9136 4 жыл бұрын
Does asyncronous code work in a similar way to multitasking in Operating Systems, but instead of switchig processes in the CPU you switch blocks of code executing in the main thread?
@G5rry
@G5rry 4 жыл бұрын
Not in the main thread, but yes, an asynchronous task may run in a separate thread. This allows the main thread to continue while that task is running.
@JohnMichaelson
@JohnMichaelson 4 жыл бұрын
Awesome vid! I've heard of jelly babies before but never seen them, thank you! Oh and the computer stuff was cool too I guess. (please accept that in the spirit intended, I've run out of words to appreciate the time you all spend making these!)
@recklessroges
@recklessroges 4 жыл бұрын
Sean impersonating MS-DOS 4.00 "File? What file?"
@jameswalker199
@jameswalker199 4 жыл бұрын
As opposed to Unix: He's a file, he's a file, _you're a file,_ I'm a file! Are there any more files I should know about?
@dstarfire42
@dstarfire42 4 жыл бұрын
Could you guys do a video (if you haven't already) about how hyperthreading works and what makes it different from the multi-tasking you're talking about here?
@xkcd000
@xkcd000 Жыл бұрын
No bears were harmed for this video🤣
@Kaeresh
@Kaeresh 4 жыл бұрын
Wouldn't the state of the program move from CREATE to RUNABLE instead of straight to RUNNING? Or is there something I'm missing?
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
I knew how co-operative multi tasking worked but not preemptive. That always seemed to get glossed over as just "the operating system takes control". Very cool that it bounces between processes very quickly just to keep things even. It seems to me like that bouncing would make it easier to run on multiple cores/CPUs, is that right? Assuming the memory address of the program can be accessed by both of course. Like, it's already divided up into slices in the preemptive model, so how difficult would it be to have a second CPU take from, say, the back of the runnable pile every time too? Just thinking about how the token bouncing and everything took up a lot of overhead in the Christmas video.
@sandeepsharma9833
@sandeepsharma9833 4 жыл бұрын
Great! I understood that idea.
@emredikmen276
@emredikmen276 3 жыл бұрын
Thank you very much for the Turkish subtitle
@isabellabihy8631
@isabellabihy8631 4 жыл бұрын
Has anyone worked with closet-sized watercooled computers in the nineties? There was a feature on the operating system MVS that was TSO, the time sharing option, where the operating system gave time slices to runnable programs. Other transaction based systems, did their own scheduling. Disclaimer: that's how I understand it, before anyone bashes me.
@WineScribble
@WineScribble 4 жыл бұрын
Love your channel - so much great information. Also Objectivity. The best youtubes!
@Gruggo
@Gruggo 4 жыл бұрын
Question: How does the OS keep track of it's interrupt clock, if it doesn't currently have control of the CPU? I remember learning about interrupts back in high school, but it was a long time ago, and it was a pretty rudimentary explanation.
@ArumesYT
@ArumesYT 4 жыл бұрын
Interrupts can be both hardware and software. The CPU can have an internal clock (or even rely on an external one) to send a periodic interrupt signal to one of its input pins (or something similar). This interrupt moves control back to the OS.
@zea_64
@zea_64 4 жыл бұрын
How does the OS make sure to not contaminate the accumulator/registers when it forcefully takes control from the program so as to not break whatever it's calculating?
@Tahgtahv
@Tahgtahv 4 жыл бұрын
Each process has an area in its context where those are stored. It needs to do this regardless of whether it's done cooperatively or preemptively. How exactly this is accomplished varies from one architecture to another.
@Conenion
@Conenion 4 жыл бұрын
@Conner McKay Whenever a context switch happens, all registers have to be saved.
@orlovsskibet
@orlovsskibet 4 жыл бұрын
@@luelou8464 wow I didn't know that. I hoped that part would've been covered in the video, but it sounds like it will come soon in another one 😊
@ecdhe
@ecdhe 4 жыл бұрын
I shall add that preemptive multi-tasking is possible because modern CPUs (x86 and ARM alike) have a clock mechanism. The OS instruct the CPU to run a clock and generate an interrupt every X milliseconds. The OS also register their own handler when this interrupt occurs. So all the OS has to do is to wait for the CPU to stop any execution, switch to kernel mode and call the OS handler which then calls the OS scheduler.
@ArumesYT
@ArumesYT 4 жыл бұрын
What do you consider to be "modern"? The Amiga was capable of pre-emptive multitasking using interrupts, using a CPU released in 1979.
@hyperspeed1313
@hyperspeed1313 4 жыл бұрын
What’s going on in the close up shots of the page? Looks like an algorithm is trying to stitch the image together
@LifeSizeTeddyBear
@LifeSizeTeddyBear 4 жыл бұрын
yay for ZX Spectrum tape loading colours/sounds (even though it wasn't capable of multitasking when loading from tape, given that it used CPU timing to decode the tape audio)
@Hypersteff89
@Hypersteff89 4 жыл бұрын
Got it, but doesn't the OS need a running process to handle other processes as well? If so, how does it manage to first suspend itself and then run another process?
@woodywoodlstein9519
@woodywoodlstein9519 4 жыл бұрын
Just like time sharing in the old days.
@Norsilca
@Norsilca 4 жыл бұрын
0:29 seconds in: "Now obviously we can't." Great, good to know, nice video!
@ZachTangen
@ZachTangen 4 жыл бұрын
Was mechanical interrupt a thing because of single-core CPUs? If only one process can be run at a time and if that got hung up, you would need a way to kill the program. Or is that understanding wrong?
@CasberG_
@CasberG_ 4 жыл бұрын
Video is nice , i got much information. Thanks for it. But I want to request that , please add some programming videos also.i liked whatever u teach
@astiaves
@astiaves 4 жыл бұрын
This looks nice but, does not the OS also run on the CPU? How does it manage CPU usage for other processes while also using the CPU?
@alexmeyer2394
@alexmeyer2394 4 жыл бұрын
Kernel sets an external timer, then passes control to the user process. Once the time is up, the timer sends an interrupt to the CPU, which in turn executes kernel code (i.e. the scheduler). Rinse and repeat.
@DaveWhoa
@DaveWhoa 4 жыл бұрын
process termination is yum
@stefanbogdanovic590
@stefanbogdanovic590 4 жыл бұрын
Finally, Thank you!
@superjugy
@superjugy 4 жыл бұрын
Can you run the videos in series instead of in parallel? It will be very funny to see how you guys had to record the sequence out of order so that after editing it makes sense XD. Also, where is the unboxing!? I was promised an unboxing video. XD
@ximalas
@ximalas 4 жыл бұрын
That process died of starvation. Poor scheduling algorithm and/or implementation.
@stanhope75
@stanhope75 4 жыл бұрын
Ah, now I get what they were trying to teach me during my computer science course.
@kristofferschmocker5993
@kristofferschmocker5993 4 жыл бұрын
very interesting
@TechyBen
@TechyBen 4 жыл бұрын
"The process is completely unaware there is another program running." What Intel told you not to specter that to happen? ;)
@programorprogrammed
@programorprogrammed 4 жыл бұрын
"not to specter that to happen?"?
@TechyBen
@TechyBen 4 жыл бұрын
@@programorprogrammed Very poor joke on "expect that to happen". :P
@YourTVUnplugged
@YourTVUnplugged 4 жыл бұрын
@@TechyBen Yea they did not spectre anyone to find out, but then they went with the nuclear option and then had a public meltdown! :P lol
@brantwedel
@brantwedel 4 жыл бұрын
First 1, then 2, then 3 ... In the next video I expect to see 4 Steves on a screen!
@DrSteveBagley
@DrSteveBagley 4 жыл бұрын
Not five, then eight, etc? ;)
@aDifferentJT
@aDifferentJT 4 жыл бұрын
Why doesn’t create go straight into runnable?
@AntonioNoack
@AntonioNoack 4 жыл бұрын
When you're starting a process ( as a process ), you give control to the OS anyways, so it doesn't matter. It can take out the process which is currently running.
@GilTheCohen
@GilTheCohen 4 жыл бұрын
On create other stuff is happening, like memory allocation. Also, new processes might have a different priority than other waiting processes. For example, an OS might decide to run processes with the lowest priority coefficient (a function of priority and waiting time). A new process can make the scheduler favor it over a slightly lower priority coefficient.
@sebastianbocaccio408
@sebastianbocaccio408 4 жыл бұрын
Hello! Someone can tell me how the cpu knows how to move a blocked task to the runnable status without running that task? Thanks
@kaitlyn__L
@kaitlyn__L 4 жыл бұрын
It's only "blocked" because the program was waiting on the OS to do something. The OS itself knows when it's finished that thing, and moves the task to the other pile. The task itself does not "perceive" a difference between blocked and runnable, it's entirely the OS's organisational structure and nothing more.
@sebastianbocaccio408
@sebastianbocaccio408 4 жыл бұрын
@@kaitlyn__L Thanks, you are very kind!
@Wolfcubware
@Wolfcubware 4 жыл бұрын
I want some jelly babies now damnit
@HoSza1
@HoSza1 4 жыл бұрын
Today cpus have multiple cores and even some sneaky computers have multiple cpus. Indeed multiple tasks are running in a realtime real parallel fashion.
@Furiends
@Furiends 4 жыл бұрын
Outside of process scheduling and context switching is also watchdog timers which is why a problem thats just while(true) {} doesn't freeze your entire computer. To take the jelly baby analogy further in fact the OS itself is one of the jelly babies. OSes tend to take into account how much time a process was using a system call into the OS and consider that part of its task time.
@ArumesYT
@ArumesYT 4 жыл бұрын
Not necessarily, some processors have separate "super" (OS) and "user" (applications) states, with their own separate stacks and/or registers. So the OS isn't just a jelly baby then.
@PASTRAMIKick
@PASTRAMIKick 4 жыл бұрын
I like the round robin process scheduler
@giancarloandrebravoabanto7091
@giancarloandrebravoabanto7091 4 жыл бұрын
this topic is use to known as concurrency
@filipstevanovic6460
@filipstevanovic6460 4 жыл бұрын
What about Multi threading?
@dsal3389
@dsal3389 4 жыл бұрын
so now I wonder how asynchronous programming works
@mathgeniuszach
@mathgeniuszach 4 жыл бұрын
ooooh there's candy on the desk
@rustyroche1921
@rustyroche1921 4 жыл бұрын
dr bagley is a snack
@CodeCommand
@CodeCommand 4 жыл бұрын
make a video on hard drive data and securely wiping them
@bonesmalin
@bonesmalin 4 жыл бұрын
those candies look so yummy
@aitchpea6011
@aitchpea6011 4 жыл бұрын
This is called "the interesting bit" and we'll do another video about that. Twice.
@TakanashiYuuji
@TakanashiYuuji 4 жыл бұрын
tl;dr process switching is delicious.
@CarstenGermer
@CarstenGermer 4 жыл бұрын
What kind of sweets are you using / eating in this vid? (edit for clarification: I got what kind but not the brand / name ^_^)
@DrSteveBagley
@DrSteveBagley 4 жыл бұрын
Jelly Babies. Those were made by Bassetts but other sweet manufacturers are available.
@CarstenGermer
@CarstenGermer 4 жыл бұрын
@@DrSteveBagley Got to get this or similar for my upcoming workshop on SOA. Great and inexpensive idea!
@IceMetalPunk
@IceMetalPunk 4 жыл бұрын
If you hadn't covered pre-emption, I was very ready to comment: "But while(true)!" :P
@YourTVUnplugged
@YourTVUnplugged 4 жыл бұрын
But any modern compiler will optimize that out... cmp [memorylocationthatsalwaysone],1 je AlwaysExecuteThisCode to: jmp AlwaysExecuteThisCode It will eliminate your waste of time comparing a memory location that's always going to have a value of 1, and just optimize it into an unconditional jump! :P
@xybersurfer
@xybersurfer 4 жыл бұрын
@@YourTVUnplugged that doesn't remove the need for pre-emption
@007killnoobs
@007killnoobs 4 жыл бұрын
You know your old when you call windows nt modern
The UNCOL Problem - Computerphile
11:42
Computerphile
Рет қаралды 78 М.
Multiple Processor Systems - Computerphile
14:52
Computerphile
Рет қаралды 153 М.
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
О, сосисочки! (Или корейская уличная еда?)
00:32
Кушать Хочу
Рет қаралды 6 МЛН
маленький брат прыгает в бассейн
00:15
GL Show Russian
Рет қаралды 4,5 МЛН
OS Context Switching - Computerphile
14:49
Computerphile
Рет қаралды 108 М.
How secure is 256 bit security?
5:06
3Blue1Brown
Рет қаралды 3,1 МЛН
Regular Expressions - Computerphile
17:19
Computerphile
Рет қаралды 238 М.
trigonometry like you've never seen it
25:53
Michael Penn
Рет қаралды 12 М.
ChatGPT does Physics - Sixty Symbols
16:42
Sixty Symbols
Рет қаралды 638 М.
Before Raspberry Pi and Arduino - Computerphile
15:55
Computerphile
Рет қаралды 140 М.
The Lightning Algorithm - Numberphile
12:24
Numberphile
Рет қаралды 539 М.
Bootstrapping with T-Diagrams - Computerphile
15:49
Computerphile
Рет қаралды 164 М.
Are we ready to LIVE in a NUCLEAR SILO?
13:41
DamiLee
Рет қаралды 177 М.
Web 3.0 & Privacy - Computerphile
13:39
Computerphile
Рет қаралды 88 М.
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53