Program, Interrupted - Computerphile

  Рет қаралды 126,563

Computerphile

Computerphile

7 жыл бұрын

In day to day life interruptions are annoying, but in computing they're essential. James Fowkes explains using an Arduino.
EXTRA BITS: • EXTRA BITS: Program, I...
Dijkstra's Algorithm: • Dijkstra's Algorithm -...
Thanks to Nottingham Hackspace
/ 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

Пікірлер: 249
@anon8109
@anon8109 7 жыл бұрын
- Knock knock! + Who's there? - The interrupting interrupt. + The interru... - Just a sec while I deal with something that's suddenly come up. - ... - Please proceed. + pting Interrupt who?
@thinkfast8662
@thinkfast8662 7 жыл бұрын
HAHAHAH BEST JOKE OF 2017 OMG VERY FUNNY JOHN
@umnikos
@umnikos 7 жыл бұрын
Very funny summary of the video
@arooobine
@arooobine 7 жыл бұрын
Give this person a cookie!!!
@adamkatav9752
@adamkatav9752 4 жыл бұрын
This is what STI instruction is for
@HECKproductions
@HECKproductions 3 жыл бұрын
that is literally genius
@jamesadfowkes
@jamesadfowkes 7 жыл бұрын
At a few points in this video I said "8 bytes" where I meant "8 bits". Damn it all.
@jamesadfowkes
@jamesadfowkes 7 жыл бұрын
I got nervous and talked too fast.
@iAmTheSquidThing
@iAmTheSquidThing 7 жыл бұрын
+James Fowkes You did seem a bit nervous. But you also seem like a natural teacher who answers questions very clearly. Talking to a camera is always weird and unnerving to begin with.
@Shockszzbyyous
@Shockszzbyyous 7 жыл бұрын
don't worry it happens to everyone :D
@arooobine
@arooobine 7 жыл бұрын
Don't worry I had the video playing at double speed anyway so I just blamed the fast talking on that. ;)
@user-iu1xg6jv6e
@user-iu1xg6jv6e 7 жыл бұрын
I hope it's not you who subscribed to feministfrequency channel.
@69k_gold
@69k_gold Жыл бұрын
I love the fact that James actually showed human demonstration of interrupts throughout the video
@grantmagee
@grantmagee 7 жыл бұрын
Goodness! I'm working on a digital art Arduino installation and that attachInterrupt function was EXACTLY what I needed to finish my work. Your timing on this video could not have been more perfect. Thank you kindly!
@DataCab1e
@DataCab1e 7 жыл бұрын
Show of hands: Who else remembers the days of manually configuring IRQs when installing PC hardware?
@firepower01
@firepower01 7 ай бұрын
This is a great demonstration. Definitely helped me understand this concept better.
@DinoWinoSaur
@DinoWinoSaur 7 жыл бұрын
I just learnt this yesterday in my OS class. Awesome.
@orrinnaylor3681
@orrinnaylor3681 7 жыл бұрын
Fantastic. Programming tip videos like this are awesome. I would love to see more of them.
@ze_rubenator
@ze_rubenator 7 жыл бұрын
Interrupts are no longer part of Magic The Gathering. They were initially "faster" than instants, but it lead to a whole lot of confusion, so they were scrapped in favour of a stack system.
@jort93z
@jort93z 7 жыл бұрын
man i miss the good old "play as an interrupt."
@AndersGustafsson87
@AndersGustafsson87 7 жыл бұрын
Ze Rubenator The blue countetspell deck i no longer viable eh?
@ze_rubenator
@ze_rubenator 7 жыл бұрын
Sure it is, you just have to play the interrupts as if they were instants. I believe Counterpell, Power Sink and other cards like them are still being printed as instants.
@BloCKBu5teR
@BloCKBu5teR 7 жыл бұрын
Add 3 mana of any single color to your mana pool. Tapping this artifact can be played as an interrupt aether revolt is awesome btw
@stub1116
@stub1116 7 жыл бұрын
Nice video, but how does the cpu react with Non-Maskable-Interrupts, when compared to programmable interrupts?
@DataStorm1
@DataStorm1 7 жыл бұрын
the 500ms "delay" loop, means that the button cannot be read during that 500ms, hence it not always responding, for it was inside the 500ms loop.
@hellterminator
@hellterminator 7 жыл бұрын
Thanks for repeating what was said in the video!
@probE466
@probE466 7 жыл бұрын
5:54 : It very much does not save anything in registers, you push your registers on the stack, build a new stackframe, and then execute your code.
@golarac6433
@golarac6433 7 жыл бұрын
interupts were heavely used in 8 bits systems. For example, on a NES or C64 you didn't have to check for collision between sprites, the video chip can cause an interrupt when it draws 2 sprites and they overlap
@AndrewReeman_RemD
@AndrewReeman_RemD 7 жыл бұрын
Great video! Thanks for making it :D
@romanemul1
@romanemul1 7 жыл бұрын
I wish to see video about pointers
@cgme7076
@cgme7076 7 жыл бұрын
romanemul1 :: Pointers are to access memory, and are a programming concept, not really a concept these guys will upload on. They cover broader topics. Here's a quick intro to points. On the left side of an equals sign, when declaring the name of a variable, give the variable the asterisk sign to tell the compiler you want to create a pointer (this will create a variable that can store the address of another variable or the value at that location): looks like: int* p = *anotherVar; then, on the other side of the equals sign, the asterisk means "address of" which gives you the literal adress of the variable on the disk: int *myP = *variableAlreadyDeclared the ampersan sign is used on the left side, if you are creating a "reference to" variable. what this does, is mimicks the address and value of another variable: int &referenceVar = myVariable (no asterisk for declaration, only variable name) now, the ampersan on the other side of the equals sign, is for getting the value, at a memory location. so if you get the address in a previous declaration, all you have to do is use the ampersan, and the value from that address will be stored in this variable: recent declaration: int *myPointer = *anotherVariable; new declaration: int myCopiedValue = &(myPointer); This may look very confusing, so go online and see if you can find an in-depth tutorial (I've found many, so it should be too hard)... HOPE THIS HELPED!
@soranuareane
@soranuareane 7 жыл бұрын
CGMe: I think you have it backwards. & is address-of, * is dereference. int x = 4; int* ptr_to_x = &x; // Make a pointer to x int copy_of_x = *ptr_to_x; // Copy the value of x to copy_of_x
@kaizen9451
@kaizen9451 7 жыл бұрын
I was suspicious of the syntax int* p = * anotherVar and tried to compile under Visual Studio 2015 - Visual C++ 19.0 and failed. As far as I'm aware, the legal syntax for pointer declaration and initialization is int* p = &anotherVar? *anotherVar is not "address of", & is. In using *anotherVar, you are deferencing the pointer i.e. requesting the value pointed to by 'anotherVar'. But since 'anotherVar' isn't even a pointer you'll get compiler warnings. Edit: I also think +romanemul1 request for a video regarding pointers is well justified. After all, we've had search algorithms. Not search as in the broader principles of searching, but Dijkstra's algorithm - a very specific algorithm. Edit 2: I also don't think it's justified to call pointers a concept. We have abstract data types which are by definition concepts. Not pointers?
@djdedan
@djdedan 7 жыл бұрын
pointers are memory addresses :-) best way to understand pointers is to do some asm :-)
@JuddMan03
@JuddMan03 7 жыл бұрын
BlinkY what if anotherVar is a pointer to a pointer?
@Ovenman940
@Ovenman940 7 жыл бұрын
Please can you do something on DMA and RTOSes?
@LazyMcCrazy
@LazyMcCrazy 7 жыл бұрын
You made it very easy to understand! Thank you
@lunaeclipse5768
@lunaeclipse5768 2 жыл бұрын
i remembered the moment, when i was playing video game, dota2 then my friend plugged his usb drive for charging his phone, then its start to say "Hello, Interrupt" i was so angry at that time
@davidsweeney111
@davidsweeney111 7 жыл бұрын
This is so cool, Im going to the library to get a book on this! Thanks!
@kensmith5694
@kensmith5694 7 жыл бұрын
Yes, it is extremely cool. To keep it simple he left out a bit about returning to the program. The software may decide not to do that right now. It may have all the context information for a different chunk of code and swap to it. This lets you effectively have two programs (or more) on the machine. This is how advanced OSes go back and forth between many tasks to give the effect of them all running.
@Frrk
@Frrk 7 жыл бұрын
So I programmed on an arduino last year but I never used interrupts for button presses because you couldn't debounce them in code...could I have used interrupts anyway?
@The1wsx10
@The1wsx10 7 жыл бұрын
if you want to time something, how can you subtract the time taken by interrupts?
@network_king
@network_king 7 жыл бұрын
Is this the same as an IRQ?
@mbright69
@mbright69 7 жыл бұрын
Which model laptop is on the desk there?
@JFrameMan
@JFrameMan 7 жыл бұрын
how do interrupts actually work on the hardware level? wouldn't the cpu need to poll the button anyway to find out if it should interrupt or not?
@Tfin
@Tfin 7 жыл бұрын
Unringing all the notification bells, because YT is spamming me.
@Rififi50
@Rififi50 7 жыл бұрын
What's the point of these anyway? "Subscriptions" seems to show all uploads of my subscriptions either way.
@ericsbuds
@ericsbuds 7 жыл бұрын
yeah I spent 20 minutes turning on all the bells just to have to go back and spend another 20 minutes turning them all off. fucking miss the old comment notification too. now I get a giant list of notifications at the top and I have to load the video to respond to anyone.
@ELYESSS
@ELYESSS 7 жыл бұрын
I no longer get comment reply notifications anymore
@gameking008
@gameking008 7 жыл бұрын
why would you ring all your notification bells?!
@LeRouxBel
@LeRouxBel 7 жыл бұрын
Wait a minute, did you use Processing on that video ? At around 1 min, that kinda looked like the Processing editor.
@solomontan1524
@solomontan1524 7 жыл бұрын
Does the "hardware buffer" the guy mentioned at 3:39 refer to the FIFO buffer?
@Seegalgalguntijak
@Seegalgalguntijak 7 жыл бұрын
Is that a Cinnamon desktop on the Lenovo laptop? Or is it Gnome2/MATE?
@Dracolith1
@Dracolith1 7 жыл бұрын
Interruptions of interruptions happen in real-life all the time..... You hear a knock at your door, then on the way to your door your kid jumps out in front of you and starts whining.
@karlosdaniel6537
@karlosdaniel6537 2 жыл бұрын
That's why the interrupts may have relative priorities.
@aliedperez
@aliedperez 7 жыл бұрын
actually, multi-core processors are fairly recent. I remember installing interrupt handlers in ye olde 8086. Those were simpler times indeed...
@djdedan
@djdedan 7 жыл бұрын
nothing simple about 8086 but i agree with the sentiment :-)
@aliedperez
@aliedperez 7 жыл бұрын
I said "simpler", not "simple". And I was referring more to the whole system than the processor itself, compared with current systems. But I see you agree with the sentiment, and I'm glad to have lived such times.
@yanfe384
@yanfe384 7 жыл бұрын
What happens, when I have more than 1 interrupt pin? So, if I interrupted my programm with pin 1 and while still in the inerruption routine, Interruption pin 2 fires. Can I interrupt my interruption this way?
@yanfe384
@yanfe384 7 жыл бұрын
3 seconds later in the video... ah ok XD
@felixblanke8076
@felixblanke8076 7 жыл бұрын
Do you really import Club Mate into the UK? :D (Box in the upper left corner, 6:20)
@arik_dev
@arik_dev 4 жыл бұрын
Does anyone know if interrupts can get dropped? What happens if the os gets flooded with them in a very short space of time?
Жыл бұрын
The interrupt controller tracks all interrupt lines (IRQs). For every interrupt line, a bit is set if an interrupt has been triggered on that line but not yet handled. Thus, the ISR is guaranteed to be executed sooner or later after the triggering event, but not necessarily as many times as the interrupt line was triggered.
@TheWeepingCorpse
@TheWeepingCorpse 7 жыл бұрын
i wrote my first software sprite ISR in z80 assembler on the zx spectrum in the 80s. the interrupt was in sync with the TVs vertical blank which was at 50hz. good times lol.
@olasoderlind5685
@olasoderlind5685 7 жыл бұрын
but what if i want more then one interrupt arduino and other chips have only 1 interruption-eble pin
@joker28666
@joker28666 7 жыл бұрын
its ironic that you interrupted him saying why you dont want an interrupt to an interrupt at the end of the video, kind of wanted to know. But really useful video!
@dims2805
@dims2805 4 жыл бұрын
how to stop the system interrup manually?in a manner? pliz
@AbdullahMohammadOzair
@AbdullahMohammadOzair 7 жыл бұрын
is it then possible that the delay of 500ms may actually end up being longer than that, in case where the handling of the interrupt takes more time?
@djdedan
@djdedan 7 жыл бұрын
usually your interrupt code is small and fast... sometimes you may have time to look up an address and move to a register and that's it... depending on the interrupt, from my exp.
@FyberOptic
@FyberOptic 7 жыл бұрын
I miss the days when you could hook interrupts and interact directly with video memory and registers. I don't necessary miss segmented memory, though!
@FrontalBeep
@FrontalBeep 7 жыл бұрын
I find it interesting that an "interrupt" sounds so drastic (and it probably was at the time) but nowadays when processors can execute millions of instructions per second (not even talking about multi core/multi thread stuff) it seems trivial.
@DisturbedLick
@DisturbedLick 7 жыл бұрын
1 GHz = 1 billion instructions per second. But you still need interrupts, or you computer would wasting a large chunk of that just checking every possible input.
@UntouchedWagons
@UntouchedWagons 7 жыл бұрын
1Ghz = 1 billion cycles per second, instructions can take multiple instructions
@karlosdaniel6537
@karlosdaniel6537 2 жыл бұрын
@@DisturbedLick You confused clock cycles per second with instructions per second.
@dermartologie
@dermartologie 7 жыл бұрын
I didn't quite like the explanation. Interrupts are not only used for things that need to be handled fast. A buttonhandler is also a good example for an interrupt service routine, because if you're only waiting for the user to press a button, you can halt the cpu und save power. Also all that "remembering" what the program was doing before is part of the ISR and not build into the CPU except for the program pointer. Also Interrupts in an ISR are possible. You need to disable them in the ISR yourself. Well, at least on the platforms I know.
@supersu6138
@supersu6138 3 жыл бұрын
Are interrupts bond with OS?
@ADRIANNORMANNINA
@ADRIANNORMANNINA 7 жыл бұрын
Nice Video!
@johnno4127
@johnno4127 7 жыл бұрын
Is this related to something which would happen in the 90's? I remember computers freezing, or appearing to freeze, but when you wiggled the mouse they would come back to life.
@kaizen9451
@kaizen9451 7 жыл бұрын
I think that's more to do with CPU lockout that occurred on OS's such as Windows XP et al (I know XP was available in '01 not in the 90's). I remember my uni lecturer talking about the subject and how XP was notorious for locking the CPU. Since true concurrency was not used or commercially available then also? Unless the OS could handle scheduling effectively, your events, such as mouse clicks, were placed into a queue and not processed immediately - leading to freezing.
@OmarAbdElkareem
@OmarAbdElkareem 7 жыл бұрын
please, can you make an english subtitle for your videos ? 😢
@TechyBen
@TechyBen 7 жыл бұрын
I've been actively using this little bit of function in my Arduino code. :D Now if only I can get it working... ;)
7 жыл бұрын
What are you working on? Also, if you would like me to, I may be able to assist in locating the error if you share the code. :)
@TechyBen
@TechyBen 7 жыл бұрын
No the code as much the application. I'm looking at getting the right type of sensor for my needs... then it will be getting the right code for it. I've done proof of concepts, now to tune the two (software/hardware).
7 жыл бұрын
Electronics and computer science guy here, so the offer still stands.
@farrukhsaif108
@farrukhsaif108 3 жыл бұрын
@ nice
@dreammfyre
@dreammfyre 7 жыл бұрын
Thank god for programmers.
@vicr123
@vicr123 7 жыл бұрын
EDIT: Scratch that... Seems to be answered in the extra bits... Maybe I should watch the whole video (including the outro) first... :) -What if, during an Interrupt Service Routine, another interrupt appears? Wouldn't you eventually overflow something? :/-
@stoltheds7698
@stoltheds7698 7 жыл бұрын
Victor Tran as long as there is enough RAM to remember the state before each interrupt... it shouldn't be a problem. (I gess, I don't know C)
@vicr123
@vicr123 7 жыл бұрын
Hand MArshall So a "incoming network info" interior would be placed higher than a "incoming keyboard event" interrupt? What if you have two network cards and one interrupts the other? They all have the same priority :)
@joao1982
@joao1982 7 жыл бұрын
it possible, but not recommended/best practice. the ISR should handle as fast as possible their routine. and it should be as simple as retrieving bytes and placing those in an auxiliar buffer to be handle afterwards or so, avoiding possible deadlocks on the code, etc.
@ChunkyChest
@ChunkyChest 7 жыл бұрын
lol I do the same thing no worries
@vicr123
@vicr123 7 жыл бұрын
3m0_Wr3ck Good to see it's not just me :D
@orlinzer123
@orlinzer123 7 жыл бұрын
Please do video on backpropagation algorithm in neural networks
@iAmTheSquidThing
@iAmTheSquidThing 7 жыл бұрын
I think they did. With Dr Mike Pound. Also Welch Labs has a great series on that.
@orlinzer123
@orlinzer123 7 жыл бұрын
they not
@kaizen9451
@kaizen9451 7 жыл бұрын
+or linzer Victor Lavrenko here on KZbin does an excellent series on machine learning. I only wish I had the videos when in uni.
@cgme7076
@cgme7076 7 жыл бұрын
I have been an aspiring programmer for a couple years now, and have programmed in several languages, and am currently back to C (for the time being - until I can get an Arduino board), and am also trying to decide on a degree for college. I want to know what type of degree would cover things like this, and allow me to program my own boards.
@hellterminator
@hellterminator 7 жыл бұрын
Computer engineering/embedded system design is what you want.
@cgme7076
@cgme7076 7 жыл бұрын
Thank you
@hellterminator
@hellterminator 7 жыл бұрын
CGMe You're welcome. Also, speaking of Arduino, if you're tight on money, don't hesitate to get a $5 chines clone from Aliexpress. They hold up well and since Arduino is an open source project designed to bring cheap an easy educational kits to everyone, there aren't any moral issues either (clones are perfectly fine under Arduino's license, as long as they don't use the official logo, that's trademarked). You should only get the official boards if you have the money and want to support the project.
@hellterminator
@hellterminator 7 жыл бұрын
***** They're really nice for beginners because there are easy to use libraries for pretty much anything and tons of tutorials. Also, as an ex-professional embedded system designer I still buy Arduinos because they're a nice all-in-one basic package. The last thing I need when prototyping is messing around with resonators and power circuitry. I don't really use anything from the Arduino ecosystem (I do all the coding in Atmel Studio), I just think they make for neat and cheap dev kits. They're also pretty nice for making extremely simple one-offs that aren't worth making a dedicated PCB for (because you need like one or two extra components beside the Arduino). A $1.50 Pro Mini clone with a sensor directly soldered on beats leaving breadboards all around the place.
@tyr1224
@tyr1224 3 жыл бұрын
Have you ever written an interrupt routine?
@mikejones-vd3fg
@mikejones-vd3fg 10 ай бұрын
I did once, it went like this "counter++" it was for a delay thing i was trying to implement with chatgtp's help and it had me incrimenting a counter in the routine, didnt work in the end
@armornick
@armornick 6 жыл бұрын
I don't know how Linux and Mac do it, but Windows actually puts all of the interrupt events into a message queue and sends them to every Window that's listening. Modern operating systems don't give user-mode applications direct access to the interrupts.
@smegskull
@smegskull 7 жыл бұрын
are controller inputs in video games interrupts then?
@MarkKing1979
@MarkKing1979 7 жыл бұрын
smegskull yes
@smegskull
@smegskull 7 жыл бұрын
Mark King ok. cool. can VBA do interrupts?
@kalleguld
@kalleguld 7 жыл бұрын
No, interrupts are handled by the operating system. But if you set up your VBA program correctly, the OS will trigger an event when the user presses a controller button.
@rabreu08
@rabreu08 7 жыл бұрын
Why not go full event based programming?
@emreproxtr
@emreproxtr 3 ай бұрын
Thanks Sam Porter Bridges
@Bentehest
@Bentehest 7 жыл бұрын
Sorry to say this, but I think you should take care of the broken piece of wire in the middle part of row 15 of your board. May I suggest a pair of tweezers? :) 2:46
@SKyrim190
@SKyrim190 11 ай бұрын
Who else was looking at the green LED and going "what is he talking about, this is not flickering at all?" for a while?
@GuildOfCalamity
@GuildOfCalamity 7 жыл бұрын
surprised there was no mention of pushing and popping the stack
@izimsi
@izimsi 7 жыл бұрын
GuildOfCalamity That video has so simple explanation, that it actually gives pretty much no information at all.
@jamesadfowkes
@jamesadfowkes 7 жыл бұрын
Thought about it, decided I should keep it as simple as I could.
@GuildOfCalamity
@GuildOfCalamity 7 жыл бұрын
Right, you could've blown minds by getting into instruction pointers.
@alecclews
@alecclews 7 жыл бұрын
Ow! I never knew Arduino processing supported creating ISRs. I'll have me some of that...
@necropola
@necropola 7 жыл бұрын
Developers should never get away with polling (in userspace) and sleep() should be banned. Don't get me wrong, I like this video, because the micro-controller perspective -- where you don't have the Operating System handling the actual interrupt -- is a good starting point into the area/problems of asynchronous (inter-process) communication. It would be nice to see a followup showing how kernel and user space work together when handling events, what a mutex/semaphore is and why select()/poll()/epoll() is such a cool system call.
@kensmith5694
@kensmith5694 7 жыл бұрын
I would make an exception for a sleep() for over a minute.
@DisturbedLick
@DisturbedLick 7 жыл бұрын
I think that would be a very bad idea, as it's a long arbitrary length. And would cause a lot of bugs for developers. I know Android will throw an ANR (app not responding) if your UI thread takes over 5 seconds to render the next frame. But other threads can sit in the background as long as you want. You may want to sleep a thread for awhile, say in a game where you're randomly spawning items on a timer. There are better ways to do that, but it works.
@necropola
@necropola 7 жыл бұрын
***** When your program needs to do more than just display/update a clock, i. e. you need to catch some sort of (I/O-)event, using sleep() in a polling loop is wrong. I'm beginning to wonder, whether threads have been invented for X Window developers who didn't know select(). ...
@hellterminator
@hellterminator 7 жыл бұрын
***** I'm beginning to wonder if select was invented for dummies who didn't know how to simply plug their code into the main system loop. /s 1. Threads are much simpler than select, what's wrong with that? 2. Most environments won't let you group all kinds of events into a single select (i.e. you can use select to wait on multiple network sockets, but not on a socket or a key press) and even if they did, the resulting code would be a mess. 3. Select doesn't facilitate preemption. If your program performs some non-trivial computation (like video rendering), it will be completely frozen until that computation finishes. What's that? You want to prepare the next rendering job while the current one is being processed? Tough luck, we removed threads because ***** didn't like them, so you're gonna have to wait.
@DisturbedLick
@DisturbedLick 7 жыл бұрын
+hellterminator, Do you keep deleting your comments after people reply to them?
@7markhunter
@7markhunter 7 жыл бұрын
I prefer the idea of increasing the buffer size
@xybersurfer
@xybersurfer 7 жыл бұрын
yes, i also prefer the idea of accommodating the hardware to fit the conceptual ideas
@ManWithBeard1990
@ManWithBeard1990 7 жыл бұрын
Just a quick FYI that has nothing to do with computers, but the whole point of revolving doors is that the inside and outside are never connected. You need that in some buildings because the air inside is at a different temperature, and due to convection a pressure difference between inside and outside will exist at the bottom and the top of the building.
@voiceoftreason1760
@voiceoftreason1760 6 жыл бұрын
I would have made screenshots of the arduino program for this video.
@DrZygote214
@DrZygote214 Жыл бұрын
Okay, I have a question. What happens if a different interrupt comes in before the first ISR is finished? How do you guarantee that the system won't be locked out by a swamp of constant interrupts?
Жыл бұрын
There are a few ways, depending on the platform. Typically, interrupts are disabled until the ISR re-enables them (which could happen automatically when the CPU flags are restored when the ISR returns, this is probably the most "atomic" way to do it). Often the ISR also has to tell whatever hardware caused the interrupt that it is done, and that it can now send another interrupt, as the hardware often won't send another interrupt before the previous interrupt has been dealt with. Interrupts may also have priorities. On x86, even if interrupts are enabled on the cpu, the programmable interrupt controller (PIC) will only interrupt any executing ISR (before the ISR has told the PIC that it's done) if the new interrupt is of higher priority.
@ivandagiant
@ivandagiant 7 ай бұрын
In my class we had levels of interrupts, higher levels could cause a nester interrupt but lower levels would be ignored
@felador5959
@felador5959 7 жыл бұрын
I'm no expert but isn't there a way of having multiple threads and isn't that more suitable and recognisable by other programmers?
@iAmTheSquidThing
@iAmTheSquidThing 7 жыл бұрын
Yes, but not on a tiny microprocessor like the one in an Arduino.
@iAmTheSquidThing
@iAmTheSquidThing 7 жыл бұрын
+Kenpachi Zaraki As I understand it, though. It wouldn't really be running multiple threads. It would just be simulating it by _protothreading_, switching back and forth between two sets of instructions.
@AndersJackson
@AndersJackson 7 жыл бұрын
***** well, Arduino is not one of those systems. And it add complexity on a low performance unit. It is a reason that Multics didn't become a commercial success...
@AndersJackson
@AndersJackson 7 жыл бұрын
***** yes, so what? This video was about that hardware and libraries...
@xybersurfer
@xybersurfer 7 жыл бұрын
if there are multiple threads then there is thread switching, and if your thread was not the one running then it could have missed the signal. it's not so much about doing multiple things at the same time. it's more about the guarantee of not missing a signal. also by introducing multiple threads it becomes very hard to give guarantees about the time it takes the system to respond (a.k.a. real time). which is a lot of times important for embedded devices
@slendi9623
@slendi9623 5 жыл бұрын
the only problem i have with my os, is idk how to handle keyboard
@kaizen9451
@kaizen9451 7 жыл бұрын
I'm assuming the interrupt code used in this example was a 3rd party library?
@jamesadfowkes
@jamesadfowkes 7 жыл бұрын
Yeah, Arduino takes care of all of that for you.
@kaizen9451
@kaizen9451 7 жыл бұрын
OK interesting, thank you. I had a uni project which required similar characteristics of the Arduino as was demonstrated in this video. Though as far as I was aware at the time, Arduino had no native programmable interrupts. I relied on polling for demonstration purposes.
@minutebrainperson8324
@minutebrainperson8324 7 жыл бұрын
I like the, title.
@rkpetry
@rkpetry 7 жыл бұрын
"Interrupts" are exactly what they sound like: crude mismanagement of task scheduling in an obviously multitask environment, by 'bullying' the CPU into excessive make-work-action-administrative processing resulting in thrashing and clock-heating and ultimately exposure of vulnerabilities culminating in security breaches....
@balala7567
@balala7567 Жыл бұрын
Would you rather: -Check the time every second to see if it's time for something *or* -Set an alarm for that thing
@AmolGautam
@AmolGautam 3 ай бұрын
nice
@hieil650
@hieil650 7 жыл бұрын
that's uncomfortable to watch, and I'm understanding
@Kal3it
@Kal3it 7 жыл бұрын
Please add spanish subtitles :(
@ZipplyZane
@ZipplyZane 7 жыл бұрын
Suggestion: instead of putting the cards on top of the videos, why not put the videos down below the cards? You've got plenty of room!
@jamesyu1093
@jamesyu1093 7 жыл бұрын
*British* spelling: _programme_ _American_ spelling: program
@ivuldivul
@ivuldivul 7 жыл бұрын
Upvote if you tried to mask non-maskable interrupt.
@Brutaltronics
@Brutaltronics 7 жыл бұрын
oh damn arduinos everywhere!
@touisbetterthanpi
@touisbetterthanpi 7 жыл бұрын
Isn't Linux built on interrupts?
@jpratt8676
@jpratt8676 7 жыл бұрын
David Sullivan Most OSs have a concept of interrupts because they manage complex hardware. It is not OS specific
@NakushitaNamida
@NakushitaNamida 7 жыл бұрын
-Please make some efforts for pronunciation , a lot of computerphile viewers are not from an english speaking country and i had a lot of trouble understanding you. Anyway thanks for the efforts- [EDIT] finished the video , it just seems James Fowkes is just not at ease with a camera pointed toward him. With some focus i managed to understand everything .
@DanDart
@DanDart 7 жыл бұрын
Irony as loading bar at 0:02
@RandomNullpointer
@RandomNullpointer 7 жыл бұрын
The Kripke accent :)
@linuxisstillthebest6863
@linuxisstillthebest6863 7 жыл бұрын
I haz the same raspberry Pi and the same pinboard :)
@lolagracew3671
@lolagracew3671 3 жыл бұрын
Do you still have them
@divasimao5290
@divasimao5290 7 жыл бұрын
It seems that some of you like gnome classic :)
@notsoverflow
@notsoverflow 7 жыл бұрын
algo helper comment
@jaymalby
@jaymalby 7 жыл бұрын
Second!
@tankmohit
@tankmohit 7 жыл бұрын
+1 for gnome
@nysonrizqi1428
@nysonrizqi1428 7 жыл бұрын
first one!!
@maw9406
@maw9406 7 жыл бұрын
Nyson Rizqi cra
@goldchalice
@goldchalice 7 жыл бұрын
I've never heard of the term "Interrupt". What the programmer in the video seems to describing is Event handling? I take it "Interrupts" are a very low level concept.
@peterlinddk
@peterlinddk 7 жыл бұрын
Interrupts are what happens in the hardware. Event handling is how the software (higher level languages, and APIs mostly) handles those interrupts. The main difference is that the event handling is not necessarily driven by interrupts, but could be done by polling - your program wouldn't know the difference.
@garbagegamer6198
@garbagegamer6198 7 жыл бұрын
First dislike
@MrBeanbones
@MrBeanbones 7 жыл бұрын
Thecubeing mann 👎
@valentinidk6101
@valentinidk6101 7 жыл бұрын
Why though?
@yepperdeedooda
@yepperdeedooda 7 жыл бұрын
I'm pretty sure you need to be really smart to even kind of understand this. I love trying to fix things on my own, but this is way too smart for me.
@LazyPanda21
@LazyPanda21 7 жыл бұрын
3rd year Electronics engineer here It's actually one of the easiest concepts to understand and apply while studying microcontroller architecture, and we had to do it using Assembly
@assalane
@assalane 7 жыл бұрын
you need to learn programming and how computers work. Saying "you need to be smart" do to anything is just an excuse
@yepperdeedooda
@yepperdeedooda 7 жыл бұрын
Azthecx yeah, too confusing. I just learned what an integer was. But I still want to be able to fix my computer. My battery swelled up and it's dead now and I need to have it plugged in for it to work.
@yepperdeedooda
@yepperdeedooda 7 жыл бұрын
assalane I am taking a computer science class though.
@valentinidk6101
@valentinidk6101 7 жыл бұрын
Ксения Ковалевская​​ ... an integer... are you serious? i honestly think you shut quit this already
@101m4n
@101m4n 7 жыл бұрын
This guy looks a bit like ricky gervais... Hate that guy.
Hardware interrupts
27:36
Ben Eater
Рет қаралды 589 М.
Multithreading Code - Computerphile
15:54
Computerphile
Рет қаралды 380 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 11 МЛН
Did you believe it was real? #tiktok
00:25
Анастасия Тарасова
Рет қаралды 51 МЛН
What's Virtual Memory? - Computerphile
22:40
Computerphile
Рет қаралды 175 М.
Vectoring Words (Word Embeddings) - Computerphile
16:56
Computerphile
Рет қаралды 284 М.
Multiple Processor Systems - Computerphile
14:52
Computerphile
Рет қаралды 153 М.
Machine Code Explained - Computerphile
20:32
Computerphile
Рет қаралды 110 М.
How Interrupts Work: and why they are better than polling
28:58
Coding Coach
Рет қаралды 1,8 М.
Physics of Computer Chips - Computerphile
12:00
Computerphile
Рет қаралды 611 М.
The Fetch-Execute Cycle: What's Your Computer Actually Doing?
9:04
Tom Scott
Рет қаралды 1,8 МЛН
How do hardware timers work?
31:17
Ben Eater
Рет қаралды 963 М.
Multiple Dimension Error Correction - Computerphile
16:36
Computerphile
Рет қаралды 109 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 11 МЛН